Title: Restore profiling child monitor Lib files with child PID enumeration by youknowdot · Pull Request #9496 · RustPython/RustPython · GitHub
Open Graph Title: Restore profiling child monitor Lib files with child PID enumeration by youknowdot · Pull Request #9496 · RustPython/RustPython
X Title: Restore profiling child monitor Lib files with child PID enumeration by youknowdot · Pull Request #9496 · RustPython/RustPython
Description: Scope Split the child-monitor Lib cohort from #8954: restore Lib/profiling/sampling/_child_monitor.py and Lib/test/test_profiling/test_sampling_profiler/test_children.py through actual scripts.update_lib migrate. Both files are byte-identical to pinned CPython d220409a13b77de7a6c30abe16ea90db01528edc; no additional skips, expected-failure markers, or weakened assertions are introduced. Add _remote_debugging.get_child_pids(pid, *, recursive=True) with native process snapshots and breadth-first descendant traversal: /proc on Linux/Android, libproc on macOS, and ToolHelp on Windows. Preserve platform snapshot ordering, suppress duplicate PIDs, release owned OS resources, distinguish allocation/unsupported states from OS errors, and preserve integer-index and truth-conversion ordering and user exceptions. No new dependency or dependency pin change. Deliberately partial profiling support This is PID enumeration plus canonical Lib restoration, not complete subprocess profiling. RemoteUnwinder still raises NotImplementedError. Restoring _child_monitor.py makes the CLI monitor import available, but does not make sampling or full --subprocesses E2E functional. The canonical test file has eight classes using the existing remote-debugging capability guard and a separately guarded argument-builder class. These guards are not changed or forced false. Full module import and effectful capability probing were not part of the bounded local checks; no observed eight-class skip or full-suite success is claimed. Validation Normal configured commit hooks passed, including Ruff, rustfmt, redundant-patch checking, and cspell. The final rebased head 7ec9c5afde9a906a87dedcaa5df76fe6356e4626 passed guarded offline locked check, strict Clippy, and CLI build with actual current-source VM opt-level 3 invocation and unchanged source/tool/config snapshots. Six bounded observations on that exact head: pinned CPython and RustPython each ran fixed native argument checks, one AST-extracted canonical argument-builder test, and an owned child/grandchild query. Every process exited 0 with empty stderr and all owned process groups removed. The helper test passed; all seven normalized child membership/uniqueness/type results matched. Argument comparisons: nine of ten rows match exactly. The extra-positional case has the same TypeError and no conversion callbacks, but retains a pre-existing generic binding wording difference: CPython get_child_pids() takes exactly 1 positional argument (2 given) versus RustPython get_child_pids expected 1 argument, got 2. No function-specific workaround or global formatter change is included. Earlier check failure (return-wrapper type) and strict Clippy failure (four std/core aliases) were fixed; failure logs were preserved and subsequent checks used explicit cache provenance. The branch is rebased on main c2bb4503 (#9494), with no conflict or profiler-file content change. Check (54.03 s), strict Clippy (55.92 s), CLI build (255.32 s), and all six observations were rerun on this new composition. Cached compiler artifacts were reused only after explicit inventory/owner verification; current-source VM recompilation was observed. Earlier original-base evidence remains separate. Only Linux x86_64 has been compiled locally. macOS/Windows compilation awaits CI; Android is source-reviewed only. Local checks do not cover permission/error branches, complete profiler tests, remote memory access, or full E2E behavior. CI success would not by itself establish CPython diagnostic or full profiler compatibility. AI assistance OpenAI Codex assisted with the implementation, canonical update_lib migration, source review, guarded validation, and this description. Validation boundaries and remaining unsupported behavior are stated above. Summary by CodeRabbit New Features Added get_child_pids to retrieve the process IDs of a process’s children, with recursive descendant lookup enabled by default and an option to return only direct children. Process-tree lookup is available on Linux, Android, macOS, and Windows. Unsupported platforms report that the feature is unavailable. Invalid process IDs and lookup failures are reported as Python exceptions.
Open Graph Description: Scope Split the child-monitor Lib cohort from #8954: restore Lib/profiling/sampling/_child_monitor.py and Lib/test/test_profiling/test_sampling_profiler/test_children.py through actual scripts.upda...
X Description: Scope Split the child-monitor Lib cohort from #8954: restore Lib/profiling/sampling/_child_monitor.py and Lib/test/test_profiling/test_sampling_profiler/test_children.py through actual scripts.upda...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9496
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:886a32a6-160f-6a6c-f087-57781fbeb848 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9C08:EA06E:3AF41FA:4AE9D06:6B01E6BD |
| html-safe-nonce | d06635ccd75543d0d09cfe4a73ada0693faa9fc4dc7c0ff9311648d5070e8716 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzA4OkVBMDZFOjNBRjQxRkE6NEFFOUQwNjo2QjAxRTZCRCIsInZpc2l0b3JfaWQiOiI1NTIyNDIxNTMwMjU4MTcxNTgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ca5453f20689e9ed539c7efa8d2f7051c2462fc438b2201314a0d874aaad392d |
| hovercard-subject-tag | pull_request:5096989864 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9496/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Scope Split the child-monitor Lib cohort from #8954: restore Lib/profiling/sampling/_child_monitor.py and Lib/test/test_profiling/test_sampling_profiler/test_children.py through actual scripts.upda... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width