MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/profiling/sampling/_child_monitor.py:66–84  ·  view source on GitHub ↗

Initialize the child process monitor. Args: pid: Parent process ID to monitor cli_args: CLI arguments to pass to child profilers output_pattern: Pattern for output files (format string with {pid})

(self, pid, cli_args, output_pattern)

Source from the content-addressed store, hash-verified

64 """
65
66 def __init__(self, pid, cli_args, output_pattern):
67 """
68 Initialize the child process monitor.
69
70 Args:
71 pid: Parent process ID to monitor
72 cli_args: CLI arguments to pass to child profilers
73 output_pattern: Pattern for output files (format string with {pid})
74 """
75 self.parent_pid = pid
76 self.cli_args = cli_args
77 self.output_pattern = output_pattern
78
79 self._known_children = set()
80 self._spawned_profilers = []
81 self._lock = threading.Lock()
82 self._stop_event = threading.Event()
83 self._monitor_thread = None
84 self._poll_count = 0
85
86 def __enter__(self):
87 self._monitor_thread = threading.Thread(

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
LockMethod · 0.80
EventMethod · 0.80

Tested by

no test coverage detected