diff options
| author | Ian Rogers <irogers@google.com> | 2026-09-25 23:19:45 -0700 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-09-26 20:49:28 +0200 |
| commit | c3034e70c6d4a2883a51e852a60b2c0ffa64703d (patch) | |
| tree | bd9ce0a3eba7f43b21ccd877ced42c284126b973 /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | 6ceccefad0751966ec63713e2855095caf296c54 (diff) | |
| download | linux-next-c3034e70c6d4a2883a51e852a60b2c0ffa64703d.tar.gz linux-next-c3034e70c6d4a2883a51e852a60b2c0ffa64703d.zip | |
perf python: Port stackcollapse to perf module
Port stackcollapse.py from tools/perf/scripts/python/ to a standalone
script in tools/perf/python/ refactored into a StackCollapseAnalyzer
class.
Improvements compared to the legacy script:
- Traverse sample.callchain directly from perf.session without
allocating per-event dictionaries, and fall back to sample.symbol when
a sample has no callchain.
- Replace deprecated optparse with argparse, adding -i/--input alongside
--include-tid, --include-pid, --no-comm, --tidy-java, and --kernel.
- Handle BrokenPipeError cleanly when output is piped into downstream
tools (such as head or flamegraph.pl).
Add a shell test (test_stackcollapse_python.sh) using a CPU workload
(perf test -w noploop) to verify the standalone script.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
