|
Replace the legacy Perl script wakeup-latency.pl with a standalone
Python script in tools/perf/python/wakeup-latency.py using the perf
Python module.
Improvements compared to the legacy Perl script:
- Remove the dependency on libperl and Perf::Trace::Util.
- Track wakeup timestamps per-task (keyed by the wakee PID on
sched:sched_wakeup and matched against next_pid on sched:sched_switch)
rather than per-CPU, avoiding mixed latencies when multiple wakeups
occur on a CPU before a context switch.
- Guard print_totals() when total_wakeups == 0 (printing 'N/A' instead
of dividing by zero when a trace contains no matched wakeup/switch
pairs).
- Add argparse CLI options (-i/--input) and full type annotations.
Add a shell test
(test_wakeup_latency_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>
|