]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-149296: Add `dump` subcommand to sampling profiler for one-shot stack snapshots...
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 4 May 2026 00:02:33 +0000 (01:02 +0100)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 00:02:33 +0000 (01:02 +0100)
commit3efd2f4db6de0990136a9503910cbb36343ec0af
treeb5d6b45e473ff9204d4622928dd5c37d17e031b9
parent2e94f14310e8ab62f41dd01276f2c69cb3d36da2
gh-149296: Add `dump` subcommand to sampling profiler for one-shot stack snapshots (#149297)

Adds `python -m profiling.sampling dump <pid>`, which prints a single
traceback-style snapshot of a running process's Python stack via the
existing `_remote_debugging` unwinder. Supports per-thread status,
source line highlighting, optional bytecode opcodes, and async-aware
task reconstruction (`--async-aware`, default `--async-mode=all`).
Doc/library/profiling.sampling.rst
Doc/whatsnew/3.15.rst
Lib/_colorize.py
Lib/profiling/sampling/cli.py
Lib/profiling/sampling/collector.py
Lib/profiling/sampling/dump.py [new file with mode: 0644]
Lib/profiling/sampling/sample.py
Lib/test/test_profiling/test_sampling_profiler/test_cli.py
Lib/test/test_profiling/test_sampling_profiler/test_dump.py [new file with mode: 0644]
Lib/test/test_profiling/test_sampling_profiler/test_profiler.py
Misc/NEWS.d/next/Library/2026-05-02-19-09-04.gh-issue-149296.DuKF0j.rst [new file with mode: 0644]