Regression on perf stat command on s390 z/VM systems
On linux-next since tag next-20250917 several test cases fail on s390 z/VM machines:
88 perf stat CSV output linter
91 perf stat JSON output linter
93 perf stat STD output linter
There are more, all caused by the same issue.
I bisected this down to
commit 9eac5612da1c91 ("perf stat: Don't skip failing group events")
Before this commit the command
# perf stat -- true Performance counter stats for 'true':
143,936 task-clock # 0.333 CPUs utilized
0 context-switches # 0.000 /sec
0 cpu-migrations # 0.000 /sec
43 page-faults # 298.744 K/sec
<not supported> cycles 0.000431791 seconds time elapsed
0.000061000 seconds user
0.000439000 seconds sysThis is correct. On z/VM a linux guest has no PMU and the event 'cycles' does not exist. This is shown as 'not supported' and the fall back was task-clock, a software event. Also the perf stat exit code was 0.
With commit 9eac5612da1c91
that behavior changed:
# perf stat -- true Error: The cycles event is not supported. # echo exit code $? exit code 255 #
There is no fall back to event task-clock and no further output to post-process. Also the perf tool now exits with non-zero exit code.
This breaks a lot of test cases.
Was this done on intension? Can we add a fallback to use a software event cpu-clock or task-clock when the hardware event 'cycles' is not available.
How to proceed with the issue? Any suggestions?
Thanks a lot for your help.
Signature · 9 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany -- IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294