-
Notifications
You must be signed in to change notification settings - Fork 536
Expand file tree
/
Copy path_stack.pyi
More file actions
79 lines (68 loc) · 2.87 KB
/
Copy path_stack.pyi
File metadata and controls
79 lines (68 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""Type stubs for the native `_stack` C extension module."""
import asyncio
from types import FrameType
from typing import Any
from typing import Optional
from typing import Sequence
from typing import Union
# Core stack v2 functions
def start(min_interval: float = ...) -> bool: ...
def stop() -> None: ...
def is_origin_task_linking_enabled() -> bool: ...
# Sampling configuration
def set_adaptive_sampling(do_adaptive_sampling: bool = False) -> None: ...
def set_target_overhead(target_overhead: float) -> None: ...
def set_max_sampling_period(max_interval_us: int) -> None: ...
def set_max_threads(max_threads: int) -> None: ...
def set_uvloop_mode(thread_id: int, uvloop_mode: bool) -> None: ...
def set_interval(new_interval: float) -> None: ...
# Memory copy strategy
def set_fast_copy(enabled: bool) -> None: ...
def is_safe_copy_failed() -> bool: ...
def fast_copy_memory_active() -> bool: ... # test introspection: is safe_memcpy active?
def _set_fast_copy_warmup_seconds(seconds: float) -> None: ... # test-only; before start
def segv_handler_installed() -> bool:
"""Return True if our handler is the installed disposition for SIGSEGV and SIGBUS.
Primarily test introspection: it queries the live disposition via sigaction(2)
for both signals on every call, so it is costly. Do not call it on hot paths.
"""
...
# span <-> profile association
def link_span(
span_id: int,
local_root_span_id: int,
span_type: Optional[str] = None,
) -> None: ...
def unlink_span(expected_span_id: int) -> None: ...
def clear_span() -> None: ...
# executor worker thread <-> originating asyncio task association
def link_origin_task(
task_id: int,
task_name: Optional[str] = None,
) -> None: ...
def unlink_origin_task() -> None: ...
# Thread management
def register_thread(python_thread_id: int, native_id: int, name: str) -> None: ...
def unregister_thread(python_thread_id: int) -> None: ...
# Asyncio support
def track_asyncio_loop(thread_id: int, loop: Optional[asyncio.AbstractEventLoop]) -> None: ...
def link_tasks(parent: asyncio.Task[Any], child: asyncio.Future[Any]) -> None: ...
def weak_link_tasks(parent: asyncio.Task[Any], child: asyncio.Future[Any]) -> None: ...
def init_asyncio(
scheduled_tasks: Sequence[asyncio.Task[Any]],
eager_tasks: Optional[Sequence[asyncio.Task[Any]]],
) -> None: ...
# Greenlet support
def track_greenlet(greenlet_id: int, name: str, frame: Union[FrameType, bool, None]) -> None: ...
def untrack_greenlet(greenlet_id: int) -> None: ...
def link_greenlets(greenlet_id: int, parent_id: int) -> None: ...
def update_greenlet_switch(
origin_id: int,
origin_frame: Union[FrameType, bool, None],
target_id: int,
target_frame: Union[FrameType, bool, None],
update_target_frame: bool,
) -> None: ...
# Native call monitoring (sys.monitoring bridge)
def start_native_monitoring() -> None: ...
def stop_native_monitoring() -> None: ...