Commit graph

61 commits

Author SHA1 Message Date
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
Hugo van Kemenade
5b5263648f
gh-142927: Tachyon: Start with user's default light/dark theme (#142987) 2025-12-20 02:36:09 +01:00
ivonastojanovic
cbc0851ada
gh-138122: Improve bytecode panel (#142910)
The bytecode panel appears when a user generates a heatmap with
--opcodes and clicks the button to unfold a line and display the
bytecode instructions. Currently, an empty space appears on the
left where the line number, self, and total columns are displayed.
This area should instead extend those columns, rather than leaving
a gap.
2025-12-18 11:43:39 +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
ivonastojanovic
8c87bcd7f2
gh-138122: Update Tachyon dark theme colors (#142841) 2025-12-16 20:58:56 +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
Pablo Galindo Salgado
52daab111b
gh-138122: Fix sample counting for filtered profiling modes (#142677) 2025-12-14 03:31:51 +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
Stan Ulbrych
40ac3a9343
gh-138122: Tachyon Flamegraph: Make toggle keyboard accesible and adjust sidebar collapse CSS (#142638) 2025-12-12 17:27:12 +00:00
Stan Ulbrych
340a684674
gh-138122: Add docs button to Tachyon heatmap and flamegraph (#142614) 2025-12-12 15:06:28 +00:00
Pablo Galindo Salgado
519bee474b
gh-138122: Add code examples to the profiling.sampling ddocs (#142609) 2025-12-12 01:37:47 +00:00
ivonastojanovic
3b3838823a
gh-138122: Add inverted flamegraph (#142288)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-12 01:36:28 +00:00
Pablo Galindo Salgado
1356fbed7b
gh-142374: Fix recursive function cumulative over-counting in sampling profiler (#142378) 2025-12-12 00:50:17 +00:00
Stan Ulbrych
b1c9582ebe
gh-138122: Tachyon heatmap: Make toggle switches keyboard accessible (#142601) 2025-12-11 21:58:09 +00:00
Stan Ulbrych
2eca80ffab
gh-138122: Make Tachyon flamegraph and heatmap output more similar (#142590) 2025-12-11 21:28:42 +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
Stan Ulbrych
0dd83111ab
Tachyon: Fix heatmap line highlight animation overriding heat colors (#142522) 2025-12-11 04:30:16 +00:00
Pablo Galindo Salgado
5b19c75b47
gh-138122: Make the tachyon profiler opcode-aware (#142394) 2025-12-11 03:41:47 +00:00
Stan Ulbrych
2db9573e23
Tachyon: Set favicon for heatmap pages (#142493) 2025-12-10 14:10:23 +00:00
Stan Ulbrych
b5576d8146
Tachyon: Remove spurious CSS for stat-card (#142487) 2025-12-09 19:13:54 +00:00
Stan Ulbrych
9b4ce3c429
Tachyon: Make "Tachyon" in navbar link to index.html (#142486) 2025-12-09 18:51:57 +00:00
Stan Ulbrych
09d6bf20b6
Tachyon: Fix unesecarry plural when there is a single file/sample (#142478) 2025-12-09 17:45:52 +00:00
Pablo Galindo Salgado
4279785b31
gh-140727: Restructure profiling documentation for PEP 799 (#142373)
* 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.
2025-12-09 12:55:04 +00:00
Stan Ulbrych
726e8e8def
Tachyon: Fix html output sidebar cards hidden behind section headers on hover (#142428) 2025-12-08 21:10:48 +00:00
Hugo van Kemenade
3fa1425bfb
gh-142363: Improve Tachyon flamegraph contrast (#142377) 2025-12-08 00:51:51 +00:00
Pablo Galindo Salgado
572c780aa8
gh-138122: Implement frame caching in RemoteUnwinder to reduce memory reads (#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.
2025-12-06 22:37:34 +00:00
Savannah Ostrowski
332da6295f
GH-142363: Contrast and gradient CSS fixes for Tachyon flamegraph (#142364) 2025-12-06 22:09:10 +00:00
ivonastojanovic
c91c373ef6
gh-140677 Improve heatmap colors (#142241)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-06 20:27:16 +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
Victor Stinner
d119443936
Remove unused imports (#142320) 2025-12-06 11:27:31 +00:00
Stan Ulbrych
dcac498e50
gh-142318: Fix typing 'q' at interactive help screen exiting Tachyon (#142319) 2025-12-05 19:36:28 +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
e32c975640
gh-138122: Small fixes to the new tachyon UI (#142157) 2025-12-01 18:37:46 +00:00
László Kiss Kollár
f87eb4d7cd
gh-138122: New Tachyon UI (#142116)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-01 17:34:14 +00:00
yihong
056d6c5ed9
gh-141999: Handle KeyboardInterrupt when sampling in the new tachyon profiler (#142000) 2025-11-30 02:49:13 +00:00
Pablo Galindo Salgado
ea51e745c7
gh-138122: Add thread status statistics to flamegraph profiler (#141900)
Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
2025-11-30 01:42:39 +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
Pablo Galindo Salgado
07410da204
gh-141645: Refactor tachyon's live TUI tests to not use private fields (#141806) 2025-11-21 00:35:37 +00:00
Pablo Galindo Salgado
b3383085f9
gh-141645: Add a TUI mode to the new tachyon profiler (#141646) 2025-11-20 18:27:17 +00:00
Pablo Galindo Salgado
274a26cca8
gh-135953: Simplify GC markers in the tachyon profiler (#141666) 2025-11-17 16:32:08 +00:00
Brandt Bucher
336366fd7c
GH-140643: Add <native> and <GC> frames to the sampling profiler (#141108)
- 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>
2025-11-17 13:39:00 +00:00
Pablo Galindo Salgado
89a914c58d
gh-135953: Add GIL contention markers to sampling profiler Gecko format (#139485)
This commit enhances the Gecko format reporter in the sampling profiler
to include markers for GIL acquisition events.
2025-11-17 12:46:26 +00:00
yihong
994ab5c922
gh-140729: Add __mp_main__ as a duplicate for __main__ for pickle to work (#140735) 2025-11-17 12:43:14 +00:00
Serhiy Storchaka
d8e6bdc0d0
gh-135801: Add the module parameter to compile() etc (GH-139652)
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.
2025-11-13 13:21:32 +02:00
yihong
f963864cb5
gh-141464: a typo in profiling sampling when can not run warning in linux (#141465) 2025-11-12 14:45:43 +02:00
Stan Ulbrych
d3aa5f689c
gh-140741: Fix profiling.sampling handling of error raised by target (#140745) 2025-10-29 11:38:28 +00:00
Pablo Galindo Salgado
0c66da8de4
gh-140137: Handle empty collections in profiling.sampling (#140154) 2025-10-15 14:59:12 +01:00