<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/tools/perf/python/wakeup-latency.py, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/tools/perf/python/wakeup-latency.py?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/tools/perf/python/wakeup-latency.py?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-09-26T18:49:30Z</updated>
<entry>
<title>perf python: Port wakeup-latency from Perl to perf module</title>
<updated>2026-09-26T18:49:30Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2026-09-26T06:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=97c70711fc5b7446e66340dcf8b40dd31c27b5d3'/>
<id>urn:sha1:97c70711fc5b7446e66340dcf8b40dd31c27b5d3</id>
<content type='text'>
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 &lt;irogers@google.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
