diff options
| author | Ian Rogers <irogers@google.com> | 2026-09-25 23:19:56 -0700 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-09-26 20:49:29 +0200 |
| commit | 605fd1c8b7e6677428cd8395b8191d0846e18adf (patch) | |
| tree | 65a4f5a6ca64fc0a89956825bb41f4958f4ece4e /tools/perf/scripts/python/stackcollapse.py | |
| parent | d935308817b348443acad0a7dbb82689f0e48475 (diff) | |
| download | linux-next-605fd1c8b7e6677428cd8395b8191d0846e18adf.tar.gz linux-next-605fd1c8b7e6677428cd8395b8191d0846e18adf.zip | |
perf python: Port rwtop from Perl to perf module
Replace the legacy Perl script rwtop.pl with a standalone Python script
in tools/perf/python/rwtop.py using the perf Python module.
Improvements compared to the legacy Perl script:
- Remove the dependency on libperl and Perf::Trace::Util.
- Support both offline perf.data files (via perf.session) and live
recording (via LiveSession with --live), driving periodic interval
summaries from event timestamps rather than wall-clock SIGALRM timers
so both live and offline runs produce deterministic output.
- Convert unsigned 32-bit and 64-bit error return values
(0xfffff000..0xffffffff and >= 0x8000000000000000) to negative errnos
so failed read/write syscalls are recorded in the error table rather
than inflating bytes_read / bytes_written.
- Sanitize non-printable characters in /proc/<pid>/comm to prevent
terminal control sequence injection.
Add a shell test
(test_rwtop_python.sh) 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/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
