summaryrefslogtreecommitdiffstats
path: root/Lib/profiling/sampling
Commit message (Collapse)AuthorAgeFilesLines
* gh-138122: Add --subprocesses flag to profile child processes in tachyon ↵Pablo Galindo Salgado2025-12-152-45/+421
| | | | (#142636)
* GH-142591: Tachyon does not handle non-existent file/module (#142592)Savannah Ostrowski2025-12-142-21/+107
| | | | Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* gh-138122: Fix sample counting for filtered profiling modes (#142677)Pablo Galindo Salgado2025-12-142-21/+9
|
* GH-142646: Update Tachyon to use backtick formatting in CLI help (#142647)Savannah Ostrowski2025-12-131-16/+12
|
* gh-138122: Tachyon Flamegraph: Make toggle keyboard accesible and adjust ↵Stan Ulbrych2025-12-124-22/+35
| | | | sidebar collapse CSS (#142638)
* gh-138122: Add docs button to Tachyon heatmap and flamegraph (#142614)Stan Ulbrych2025-12-128-12/+87
|
* gh-138122: Add code examples to the profiling.sampling ddocs (#142609)Pablo Galindo Salgado2025-12-121-0/+0
|
* gh-138122: Add inverted flamegraph (#142288)ivonastojanovic2025-12-125-113/+341
| | | Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* gh-142374: Fix recursive function cumulative over-counting in sampling ↵Pablo Galindo Salgado2025-12-124-43/+55
| | | | profiler (#142378)
* gh-138122: Tachyon heatmap: Make toggle switches keyboard accessible (#142601)Stan Ulbrych2025-12-114-4/+13
|
* gh-138122: Make Tachyon flamegraph and heatmap output more similar (#142590)Stan Ulbrych2025-12-116-34/+67
|
* gh-138122: Add exception profiling mode to the sampling profiler (#142561)Pablo Galindo Salgado2025-12-1110-7/+73
|
* Tachyon: Fix heatmap line highlight animation overriding heat colors (#142522)Stan Ulbrych2025-12-111-1/+0
|
* gh-138122: Make the tachyon profiler opcode-aware (#142394)Pablo Galindo Salgado2025-12-1118-135/+1980
|
* Tachyon: Set favicon for heatmap pages (#142493)Stan Ulbrych2025-12-101-0/+15
|
* Tachyon: Remove spurious CSS for `stat-card` (#142487)Stan Ulbrych2025-12-091-16/+0
|
* Tachyon: Make "Tachyon" in navbar link to `index.html` (#142486)Stan Ulbrych2025-12-092-1/+4
|
* Tachyon: Fix unesecarry plural when there is a single file/sample (#142478)Stan Ulbrych2025-12-091-2/+7
|
* gh-140727: Restructure profiling documentation for PEP 799 (#142373)Pablo Galindo Salgado2025-12-097-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add profiling module documentation structure PEP 799 introduces a new `profiling` package that reorganizes Python's profiling tools under a unified namespace. This commit adds the documentation structure to match: a main entry point (profiling.rst) that helps users choose between profilers, detailed docs for the tracing profiler (profiling-tracing.rst), and separated pstats documentation. The tracing profiler docs note that cProfile remains as a backward-compatible alias, so existing code continues to work. The pstats module gets its own page since it's used by both profiler types and deserves focused documentation. * Add profiling.sampling documentation The sampling profiler is new in Python 3.15 and works fundamentally differently from the tracing profiler. It observes programs from outside by periodically capturing stack snapshots, which means zero overhead on the profiled code. This makes it practical for production use where you can attach to live servers. The docs explain the key concepts (statistical vs deterministic profiling), provide quick examples upfront, document all output formats (pstats, flamegraph, gecko, heatmap), and cover the live TUI mode. The defaults table helps users understand what happens without any flags. * Wire profiling docs into the documentation tree Add the new profiling module pages to the Debugging and Profiling toctree. The order places the main profiling.rst entry point first, followed by the two profiler implementations, then pstats, and finally the deprecated profile module last. * Convert profile.rst to deprecation stub The pure Python profile module is deprecated in 3.15 and scheduled for removal in 3.17. Users should migrate to profiling.tracing (or use the cProfile alias which continues to work). The page now focuses on helping existing users migrate: it shows the old vs new import style, keeps the shared API reference since both modules have the same interface, and preserves the calibration docs for anyone still using the pure Python implementation during the transition period. * Update CLI module references for profiling restructure Point cProfile to profiling.tracing docs and add profiling.sampling to the list of modules with CLI interfaces. The old profile-cli label no longer exists after the documentation restructure. * Update whatsnew to link to profiling module docs Enable cross-references to the new profiling module documentation and update the CLI examples to use the current syntax with the attach subcommand. Also reference profiling.tracing instead of cProfile since that's the new canonical name.
* Tachyon: Fix html output sidebar cards hidden behind section headers on ↵Stan Ulbrych2025-12-081-1/+0
| | | | hover (#142428)
* gh-142363: Improve Tachyon flamegraph contrast (#142377)Hugo van Kemenade2025-12-082-3/+3
|
* gh-138122: Implement frame caching in RemoteUnwinder to reduce memory reads ↵Pablo Galindo Salgado2025-12-061-10/+102
| | | | | | | | | | | (#142137) This PR implements frame caching in the RemoteUnwinder class to significantly reduce memory reads when profiling remote processes with deep call stacks. When cache_frames=True, the unwinder stores the frame chain from each sample and reuses unchanged portions in subsequent samples. Since most profiling samples capture similar call stacks (especially the parent frames), this optimization avoids repeatedly reading the same frame data from the target process. The implementation adds a last_profiled_frame field to the thread state that tracks where the previous sample stopped. On the next sample, if the current frame chain reaches this marker, the cached frames from that point onward are reused instead of being re-read from remote memory. The sampling profiler now enables frame caching by default.
* GH-142363: Contrast and gradient CSS fixes for Tachyon flamegraph (#142364)Savannah Ostrowski2025-12-061-7/+7
|
* gh-140677 Improve heatmap colors (#142241)ivonastojanovic2025-12-065-151/+117
| | | | Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* GH-141565: Add async code awareness to Tachyon (#141533)Savannah Ostrowski2025-12-066-82/+213
| | | | Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* Remove unused imports (#142320)Victor Stinner2025-12-061-1/+1
|
* gh-142318: Fix typing `'q'` at interactive help screen exiting Tachyon (#142319)Stan Ulbrych2025-12-051-1/+3
|
* gh-140677 Add heatmap visualization to Tachyon sampling profiler (#140680)Pablo Galindo Salgado2025-12-0215-326/+3279
| | | | Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
* gh-138122: Small fixes to the new tachyon UI (#142157)Pablo Galindo Salgado2025-12-012-2/+4
|
* gh-138122: New Tachyon UI (#142116)László Kiss Kollár2025-12-015-1007/+1969
| | | | Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* gh-141999: Handle KeyboardInterrupt when sampling in the new tachyon ↵yihong2025-11-301-41/+47
| | | | profiler (#142000)
* gh-138122: Add thread status statistics to flamegraph profiler (#141900)Pablo Galindo Salgado2025-11-306-10/+454
| | | | Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
* gh-138122: Refactor the CLI of profiling.sampling into subcommands (#141813)Pablo Galindo Salgado2025-11-246-898/+1139
|
* gh-141645: Refactor tachyon's live TUI tests to not use private fields (#141806)Pablo Galindo Salgado2025-11-212-48/+48
|
* gh-141645: Add a TUI mode to the new tachyon profiler (#141646)Pablo Galindo Salgado2025-11-209-55/+2844
|
* gh-135953: Simplify GC markers in the tachyon profiler (#141666)Pablo Galindo Salgado2025-11-171-8/+7
|
* GH-140643: Add `<native>` and `<GC>` frames to the sampling profiler (#141108)Brandt Bucher2025-11-173-16/+56
| | | | | | | | | - Introduce a new field in the GC state to store the frame that initiated garbage collection. - Update RemoteUnwinder to include options for including "<native>" and "<GC>" frames in the stack trace. - Modify the sampling profiler to accept parameters for controlling the inclusion of native and GC frames. - Enhance the stack collector to properly format and append these frames during profiling. - Add tests to verify the correct behavior of the profiler with respect to native and GC frames, including options to exclude them. Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* gh-135953: Add GIL contention markers to sampling profiler Gecko format ↵Pablo Galindo Salgado2025-11-173-40/+265
| | | | | | (#139485) This commit enhances the Gecko format reporter in the sampling profiler to include markers for GIL acquisition events.
* gh-140729: Add __mp_main__ as a duplicate for __main__ for pickle to work ↵yihong2025-11-171-2/+9
| | | | (#140735)
* gh-135801: Add the module parameter to compile() etc (GH-139652)Serhiy Storchaka2025-11-131-1/+1
| | | | | | | Many functions related to compiling or parsing Python code, such as compile(), ast.parse(), symtable.symtable(), and importlib.abc.InspectLoader.source_to_code() now allow to pass the module name used when filtering syntax warnings.
* gh-141464: a typo in profiling sampling when can not run warning in linux ↵yihong2025-11-121-1/+1
| | | | (#141465)
* gh-140741: Fix `profiling.sampling` handling of error raised by target (#140745)Stan Ulbrych2025-10-291-4/+5
|
* gh-140137: Handle empty collections in profiling.sampling (#140154)Pablo Galindo Salgado2025-10-151-3/+8
|
* gh-135953: Add Gecko reporter to sampling profiler (#139364)ivonastojanovic2025-10-013-5/+487
| | | | Signed-off-by: Pablo Galindo Salgado <pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* gh-138122: Allow to filter by thread in tachyon's flamegraph (#139216)Pablo Galindo Salgado2025-09-257-20/+218
|
* gh-138709: Implement CPU time profiling in profiling.sample (#138710)Pablo Galindo Salgado2025-09-194-14/+68
|
* gh-135953: Reduce memory usage of stack collectors (#138875)László Kiss Kollár2025-09-144-121/+236
| | | | | | | | The stack collector base class keeps all frames until export() is called, which causes significant unnecessary memory usage. Instead, we can process the frames on the fly in the collect call by dispatching the aggregation logic to the subclass through the process_frames method. Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
* gh-135953: Prevent overflow in the profiler flamegraph hover boxes (#138880)Pablo Galindo Salgado2025-09-142-7/+33
|
* gh-71648: Optimize PNG files (GH-138842)Stan Ulbrych2025-09-121-0/+0
| | | * Only keep > 1 kb savings
* gh-138704: Add PermissionError messages to profiling.sampling (#138705)Pablo Galindo Salgado2025-09-111-1/+61
|