mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
In sctop.py:
- If an earlier interval elapsed and printed an empty table before the
target comm ('sleep') executed any syscalls, analyzer.printed became
True and the final partial interval containing the target comm's
syscalls was never flushed at EOF. Flush print_current_totals() in
finally when analyzer.syscalls is non-empty as well as when nothing
has been printed yet.
- Initialize analyzer.e_machine after creating perf.session rather than
when session is still None.
In test_sctop_python.sh:
- Use a private temporary directory via 'mktemp -d'.
- Drop '-a' and pass '-B -N --no-bpf-event' to 'perf record', and sleep
briefly in the subshell ('sh -c "sleep 0.1; sleep 0.05"') with a
bounded retry loop so 'sleep's PERF_RECORD_COMM and sys_enter events
are reliably captured under heavy load.
Fixes: b83f0bacf5 ("perf python: Port sctop to perf module")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>