cpython/Lib/test/test_profiling/test_sampling_profiler
Pablo Galindo Salgado 78b8bd521f gh-142374: Fix recursive function cumulative over-counting in sampling profiler
The sampling profiler counted every frame occurrence in a stack for
cumulative statistics. For recursive functions appearing N times in a stack,
this meant counting N instead of 1, causing cumul% to exceed 100%. A function
recursing 500 deep in every sample would show 50000% cumulative presence.

The fix tracks seen locations per sample using a reused set, ensuring each
unique (filename, lineno, funcname) is counted once per sample. This matches
the expected semantics: cumul% represents the percentage of samples where a
function appeared on the stack, not the sum of all frame occurrences.
2025-12-07 13:45:27 +00:00
..
__init__.py
_live_collector_helpers.py gh-141645: Add a TUI mode to the new tachyon profiler (#141646) 2025-11-20 18:27:17 +00:00
helpers.py gh-135953: Avoid BytesWarning when sampling profiler tests fail (GH-141719) 2025-11-19 14:43:42 +01:00
mocks.py GH-141565: Add async code awareness to Tachyon (#141533) 2025-12-06 19:31:40 +00:00
test_advanced.py gh-138122: Refactor the CLI of profiling.sampling into subcommands (#141813) 2025-11-24 11:45:08 +00:00
test_async.py GH-141565: Add async code awareness to Tachyon (#141533) 2025-12-06 19:31:40 +00:00
test_cli.py GH-141565: Add async code awareness to Tachyon (#141533) 2025-12-06 19:31:40 +00:00
test_collectors.py gh-142374: Fix recursive function cumulative over-counting in sampling profiler 2025-12-07 13:45:27 +00:00
test_integration.py gh-142374: Fix recursive function cumulative over-counting in sampling profiler 2025-12-07 13:45:27 +00:00
test_live_collector_core.py gh-142374: Fix recursive function cumulative over-counting in sampling profiler 2025-12-07 13:45:27 +00:00
test_live_collector_interaction.py gh-142318: Fix typing 'q' at interactive help screen exiting Tachyon (#142319) 2025-12-05 19:36:28 +00:00
test_live_collector_ui.py gh-141645: Refactor tachyon's live TUI tests to not use private fields (#141806) 2025-11-21 00:35:37 +00:00
test_modes.py gh-138122: Refactor the CLI of profiling.sampling into subcommands (#141813) 2025-11-24 11:45:08 +00:00
test_profiler.py gh-141999: Handle KeyboardInterrupt when sampling in the new tachyon profiler (#142000) 2025-11-30 02:49:13 +00:00
test_trend_tracker.py gh-141645: Add a TUI mode to the new tachyon profiler (#141646) 2025-11-20 18:27:17 +00:00