Commit Graph

25 Commits

Author SHA1 Message Date
László Kiss Kollár 9587726a3e gh-149430: Fix edge-cases in profiling.sampling outputs (#149431)
The line highlights on the heatmap are driven by the URL hash and the
`:target` selector. When clicking a caller/callee link for the line that
was already selected, the hash doesn't change, so the browser keeps the
existing target state and doesn't restart the animation. Due to this the
highlight only works the first time.

With this fix, line navigation goes through JavaScript. If the target
URL already points to the current location, the highlight is replayed by
clearing the animation, forcing style recalculation, and restoring it.

The `baseline_self` variable isn't initialized for structural elided
roots. This variable is accessed later unconditionally and leads to a
crash.

The child process ends up being invoked with `--diff_flamegraph` instead
of the correct argument.
2026-05-09 14:05:46 +01:00
Maurycy Pawłowski-Wieroński 04ce318522 gh-146256: Add --jsonl collector to the profiling.sampling (#146257) 2026-05-05 00:44:37 +00:00
Hugo van Kemenade ef6f0635ce gh-142389: Add backticks to stdlib argparse help to display in colour (#149384)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-05-04 22:23:18 +00:00
Pablo Galindo Salgado 3efd2f4db6 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`).
2026-05-04 01:02:33 +01:00
Pablo Galindo Salgado efde4333bf gh-148225: Validate profiling.sampling replay input (#148243) 2026-04-08 23:34:46 +00:00
ivonastojanovic f4d3c61f36 gh-138122: Add differential flame graph (#145785)
Differential flame graphs compare two profiling runs and highlight where
performance has changed. This makes it easier to detect regressions
introduced by code changes and to verify that optimizations have the
intended effect.

The visualization renders the current profile with frame widths
representing current time consumption. Color is then applied to show the
difference relative to the baseline profile: red gradients indicate
regressions, while blue gradients indicate improvements.

Some call paths may disappear entirely between profiles. These are
referred to as elided stacks and occur when optimizations remove code
paths or when certain branches stop executing. When elided stacks are
present, an "Elided" toggle is displayed, allowing the user to switch
between the main differential view and a view showing only the removed
paths.

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-03-30 12:31:06 +01:00
László Kiss Kollár ef3b8829e4 gh-142927: Clarify pstats file output in docs and CLI (#143388)
When running the `profiling.sampling` module in pstats mode, the output
can be emitted in two different ways: text to stdout or a binary file
when the `--output` argument is set.

The current documentation and help text is confusing as it does not
distinguish between these two output formats so it may be surprising to
the user to get different formats depending whether `--output` is set or not.
2026-01-03 21:16:29 +00:00
Pablo Galindo Salgado 6b9a6c6ec3 gh-138122: Move local imports to module level in sampling profiler (#143257) 2026-01-02 02:31:39 +00:00
ivonastojanovic 5d133351c6 gh-142927: Auto-open HTML output in browser after generation (#143178) 2026-01-01 19:05:45 +00:00
Marta Gómez Macías 9d92ac1225 gh-143040: Exit taychon live mode gracefully and display profiled script errors (#143101) 2025-12-27 00:36:15 +00:00
László Kiss Kollár 888d101445 gh-138122: Remove default duration for statistical profiling (#143174)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-25 19:21:16 +00:00
Pablo Galindo Salgado 7c44f37170 gh-138122: Extend binary profiling format with full source location and opcode (#143088)
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
2025-12-24 16:15:11 +00:00
László Kiss Kollár d4dc3dd9aa gh-138122: Replace --interval with --sampling-rate (#143085) 2025-12-24 13:46:33 +00:00
Pablo Galindo Salgado 81c8eb85e1 gh-138122: Add blocking mode for accurate stack traces in Tachyon (#142998) 2025-12-23 10:49:47 +00:00
Pablo Galindo Salgado 9e51301234 gh-138122: Allow tachyon to write and read binary output (#142730) 2025-12-22 23:57:20 +00:00
Hugo van Kemenade ff7f62eb23 gh-142927: Tachyon: Comma separate thousands and fix singular/plurals (#142934) 2025-12-22 14:15:57 +00:00
Keming d4095f25e8 gh-142654: show the clear error message when sampling on an unknown PID in tachyon (#142655)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-17 14:15:22 +00:00
Pablo Galindo Salgado 6658e2cb07 gh-138122: Add --subprocesses flag to profile child processes in tachyon (#142636) 2025-12-15 12:11:40 +00:00
Savannah Ostrowski f893e8f256 GH-142591: Tachyon does not handle non-existent file/module (#142592)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-14 04:58:40 +00:00
Savannah Ostrowski 3e36d37535 GH-142646: Update Tachyon to use backtick formatting in CLI help (#142647) 2025-12-13 05:20:28 +00:00
Pablo Galindo Salgado 6a0135a392 gh-138122: Add exception profiling mode to the sampling profiler (#142561) 2025-12-11 20:46:34 +00:00
Pablo Galindo Salgado 5b19c75b47 gh-138122: Make the tachyon profiler opcode-aware (#142394) 2025-12-11 03:41:47 +00:00
Savannah Ostrowski 56a442d0d8 GH-141565: Add async code awareness to Tachyon (#141533)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-06 19:31:40 +00:00
Pablo Galindo Salgado 8801c6dec7 gh-140677 Add heatmap visualization to Tachyon sampling profiler (#140680)
Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
2025-12-02 20:33:40 +00:00
Pablo Galindo Salgado 3eec46d3c3 gh-138122: Refactor the CLI of profiling.sampling into subcommands (#141813) 2025-11-24 11:45:08 +00:00