Re: [PATCH v1 1/4] perf stat: Allow no events to open if this is a "--null" run
From: Ingo Molnar
Date: Mon Dec 01 2025 - 23:52:44 EST
* Ingo Molnar <mingo@xxxxxxxxxx> wrote:
> With all 4 patches applied to v6.18 'perf stat --null'
> works fine:
>
> Tested-by: Ingo Molnar <mingo@xxxxxxxxxx>
BTW., there's a long-standing perf-stat --repeat bug
where signals don't seem to get properly propagated.
The following command takes 10 seconds to run, as
expected:
starship:~/tip> perf stat --null --repeat 10 sleep 1
Performance counter stats for 'sleep 1' (10 runs):
1.0026669 +- 0.0000503 seconds time elapsed ( +- 0.01% )
But if I try to interrupt the test:
starship:~/tip> perf stat --null --repeat 10 sleep 1
^Csleep: Interrupt
^Csleep: Interrupt
Performance counter stats for 'sleep 1' (10 runs):
0.9250 +- 0.0543 seconds time elapsed ( +- 5.87% )
The Ctrl-C only propagates to the <command>, interrupts
it (as can be seen from the shortened total runtime
that is less than 10 seconds), and otherwise results in
both an incorrect measurement and a misleading output
of the partial results.
Furthermore, the test runs to full completion - which
can be annoying if you happen to use high --repeat
counts like I sometimes do. I have to Ctrl-Z and
killall -9 perf to kill such instances.
Thanks,
Ingo