Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,6 @@ profiling.sampling.cli
profiling.sampling.constants
profiling.sampling.dump
profiling.sampling.errors
profiling.sampling.gecko_collector.CATEGORY_CODE_TYPE
profiling.sampling.gecko_collector.CATEGORY_CPU
profiling.sampling.gecko_collector.CATEGORY_EXCEPTION
profiling.sampling.gecko_collector.CATEGORY_GC
profiling.sampling.gecko_collector.CATEGORY_GIL
profiling.sampling.gecko_collector.CATEGORY_NATIVE
profiling.sampling.gecko_collector.CATEGORY_OPCODES
profiling.sampling.gecko_collector.CATEGORY_OTHER
profiling.sampling.gecko_collector.CATEGORY_PYTHON
profiling.sampling.gecko_collector.DEFAULT_SUBCATEGORY
profiling.sampling.gecko_collector.FRAME_ADDRESS_NONE
profiling.sampling.gecko_collector.FRAME_INLINE_DEPTH_ROOT
profiling.sampling.gecko_collector.GECKO_CATEGORIES
profiling.sampling.gecko_collector.GECKO_FORMAT_VERSION
profiling.sampling.gecko_collector.GECKO_PREPROCESSED_VERSION
profiling.sampling.gecko_collector.PROCESS_TYPE_MAIN
profiling.sampling.gecko_collector.RESOURCE_TYPE_LIBRARY
profiling.sampling.gecko_collector.STACKWALK_DISABLED
profiling.sampling.heatmap_collector.FileStats
profiling.sampling.heatmap_collector.TreeNode
profiling.sampling.module_utils
Expand Down
2 changes: 0 additions & 2 deletions stdlib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ posixpath: 3.0-
pprint: 3.0-
profile: 3.0-
profiling: 3.15-
profiling.sampling: 3.15-
profiling.tracing: 3.15-
Comment thread
AlexWaygood marked this conversation as resolved.
pstats: 3.0-
pty: 3.0-
pwd: 3.0-
Expand Down
32 changes: 16 additions & 16 deletions stdlib/_curses.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class window: # undocumented
def chgat(self, y: int, x: int, num: int, attr: int) -> None: ...

def clear(self) -> None: ...
def clearok(self, yes: int) -> None: ...
def clearok(self, flag: bool, /) -> None: ...
def clrtobot(self) -> None: ...
def clrtoeol(self) -> None: ...
def cursyncup(self) -> None: ...
Expand Down Expand Up @@ -480,9 +480,9 @@ class window: # undocumented
@overload
def hline(self, y: int, x: int, ch: _ChType, n: int) -> None: ...

def idcok(self, flag: bool) -> None: ...
def idlok(self, yes: bool) -> None: ...
def immedok(self, flag: bool) -> None: ...
def idcok(self, flag: bool, /) -> None: ...
def idlok(self, flag: bool, /) -> None: ...
def immedok(self, flag: bool, /) -> None: ...

@overload
def inch(self) -> int: ...
Expand All @@ -494,7 +494,7 @@ class window: # undocumented
@overload
def insch(self, y: int, x: int, ch: _ChType, attr: int = ...) -> None: ...

def insdelln(self, nlines: int) -> None: ...
def insdelln(self, nlines: int, /) -> None: ...
def insertln(self) -> None: ...

@overload
Expand All @@ -514,13 +514,13 @@ class window: # undocumented

def is_linetouched(self, line: int, /) -> bool: ...
def is_wintouched(self) -> bool: ...
def keypad(self, yes: bool, /) -> None: ...
def leaveok(self, yes: bool) -> None: ...
def move(self, new_y: int, new_x: int) -> None: ...
def mvderwin(self, y: int, x: int) -> None: ...
def mvwin(self, new_y: int, new_x: int) -> None: ...
def nodelay(self, yes: bool) -> None: ...
def notimeout(self, yes: bool) -> None: ...
def keypad(self, flag: bool, /) -> None: ...
def leaveok(self, flag: bool, /) -> None: ...
def move(self, new_y: int, new_x: int, /) -> None: ...
def mvderwin(self, y: int, x: int, /) -> None: ...
def mvwin(self, new_y: int, new_x: int, /) -> None: ...
def nodelay(self, flag: bool, /) -> None: ...
def notimeout(self, flag: bool, /) -> None: ...

@overload
def noutrefresh(self) -> None: ...
Expand Down Expand Up @@ -550,9 +550,9 @@ class window: # undocumented
@overload
def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ...

def resize(self, nlines: int, ncols: int) -> None: ...
def resize(self, nlines: int, ncols: int, /) -> None: ...
def scroll(self, lines: int = 1) -> None: ...
def scrollok(self, flag: bool) -> None: ...
def scrollok(self, flag: bool, /) -> None: ...
def setscrreg(self, top: int, bottom: int, /) -> None: ...
def standend(self) -> None: ...
def standout(self) -> None: ...
Expand All @@ -568,9 +568,9 @@ class window: # undocumented
def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> window: ...

def syncdown(self) -> None: ...
def syncok(self, flag: bool) -> None: ...
def syncok(self, flag: bool, /) -> None: ...
def syncup(self) -> None: ...
def timeout(self, delay: int) -> None: ...
def timeout(self, delay: int, /) -> None: ...
def touchline(self, start: int, count: int, changed: bool = True) -> None: ...
def touchwin(self) -> None: ...
def untouchwin(self) -> None: ...
Expand Down
102 changes: 100 additions & 2 deletions stdlib/profiling/sampling/gecko_collector.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,109 @@
from _typeshed import StrOrBytesPath
from collections.abc import Sequence
from _typeshed import Incomplete, StrOrBytesPath, StrPath
from collections.abc import Generator, Sequence
from tempfile import TemporaryDirectory
from typing import Any, ClassVar, Final, TypedDict, type_check_only

from _remote_debugging import AwaitedInfo, InterpreterInfo

from .collector import Collector, _Timestamps

@type_check_only
class _GeckoCategory(TypedDict):
name: str
color: str
subcategories: list[str]

THREAD_STATUS_HAS_GIL: Final[int]
THREAD_STATUS_ON_CPU: Final[int]
THREAD_STATUS_UNKNOWN: Final[int]
THREAD_STATUS_GIL_REQUESTED: Final[int]
THREAD_STATUS_HAS_EXCEPTION: Final[int]
THREAD_STATUS_MAIN_THREAD: Final[int]

GECKO_CATEGORIES: Final[list[_GeckoCategory]]

CATEGORY_OTHER: Final = 0
CATEGORY_PYTHON: Final = 1
CATEGORY_NATIVE: Final = 2
CATEGORY_GC: Final = 3
CATEGORY_GIL: Final = 4
CATEGORY_CPU: Final = 5
CATEGORY_CODE_TYPE: Final = 6
CATEGORY_OPCODES: Final = 7
CATEGORY_EXCEPTION: Final = 8

DEFAULT_SUBCATEGORY: Final = 0

GECKO_FORMAT_VERSION: Final = 32
GECKO_PREPROCESSED_VERSION: Final = 57

RESOURCE_TYPE_LIBRARY: Final = 1

FRAME_ADDRESS_NONE: Final = -1
FRAME_INLINE_DEPTH_ROOT: Final = 0

PROCESS_TYPE_MAIN: Final = 0
STACKWALK_DISABLED: Final = 0

DEFAULT_SPILL_BUFFER_BYTES: Final[int]

class SpillColumn:
path: str
buffer: bytearray

def __init__(self, directory: StrPath, basename: StrPath, *, buffer_bytes: int | None = None) -> None: ...
# "value" accepts the same types as json.JSONEncoder.encode()
def append(self, value: Any) -> None: ...
def flush(self) -> None: ...
def iter_tokens(self) -> Generator[str]: ...

class GeckoThreadSpill:
sample_count: int
marker_count: int
def __init__(self, directory: StrPath, tid: int) -> None: ...
def append_sample(self, stack_index: int, time_ms: float) -> None: ...
def append_marker(
self, name_idx: int, start_time: float, end_time: float, phase: int, category: int, data: dict[str, Any]
) -> None: ...
def prepare_read(self) -> None: ...

class GeckoCollector(Collector):
aggregating: ClassVar[bool]

sample_interval_usec: int
skip_idle: bool
opcodes_enabled: bool
start_time: float

global_strings: list[str]
global_string_map: dict[str, int]

threads: dict[int, dict[str, Any]]
spill_dir: TemporaryDirectory[str] | None
exported: bool

libs: list[Incomplete]

sample_count: int
last_sample_time: float
interval: float

has_gil_start: dict[Incomplete, Incomplete]
no_gil_start: dict[Incomplete, Incomplete]
on_cpu_start: dict[Incomplete, Incomplete]
off_cpu_start: dict[Incomplete, Incomplete]
python_code_start: dict[Incomplete, Incomplete]
native_code_start: dict[Incomplete, Incomplete]
gil_wait_start: dict[Incomplete, Incomplete]
exception_start: dict[Incomplete, Incomplete]
no_exception_start: dict[Incomplete, Incomplete]

gc_start_per_thread: dict[int, float]

initialized_threads: set[Incomplete]

opcode_state: dict[int, tuple[Incomplete, int, int, str, str, float]]

def __init__(self, sample_interval_usec: int, *, skip_idle: bool = False, opcodes: bool = False) -> None: ...
def collect(
self, stack_frames: Sequence[InterpreterInfo] | Sequence[AwaitedInfo], timestamps_us: _Timestamps = None
Expand Down
Loading