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)
| 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( |