Re: perf stat issue with 7.0.0rc3

From: Arnaldo Carvalho de Melo

Date: Tue Mar 17 2026 - 15:39:34 EST


On Fri, Mar 13, 2026 at 08:41:48AM -0700, Ian Rogers wrote:
> On Fri, Mar 13, 2026 at 8:19 AM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > On Fri, Mar 13, 2026 at 02:13:18PM +0100, Thomas Richter wrote:
> > > I just discovered a strange behavior on linux 7.0.0rc3.
> > > This is the epected output, however when I use the perf version 7.0.0rc3:

> > > bash-5.3# ./perf -v
> > > perf version 7.0.rc3.g1f318b96cc84
> > > bash-5.3# ./perf stat -- true
> > > Error:
> > > No supported events found.
> > > trace.args_alignment

> > And this last line is even stranger, in my case I get something else,
> > also on x86_64:

> > root@number:~# perf stat -- true
> > Error:
> > No supported events found.
> > addr2line.style
> > root@number:~#

> > On an ARM machine:

> > acme@raspberrypi:~/git/perf-tools $ perf stat -- true
> > Error:
> > No supported events found.

> > acme@raspberrypi:~/git/perf-tools $ uname -a
> > Linux raspberrypi 6.12.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.62-1+rpt1 (2025-12-18) aarch64 GNU/Linux
> > acme@raspberrypi:~/git/perf-tools $

> > I'll try to bisect this later, thanks for the report!

> Hi Arnaldo,

> Leo has pointed at the fix:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/commit/tools/perf/util/metricgroup.c?h=perf-tools-next&id=c5a244bf17caf2de22f9e100832b75f72b31d3e6
> This also showed up as missing for the LTS backports:
> https://lore.kernel.org/lkml/ad95d781-7eb2-4c0c-a9e9-aaabae8eb602@xxxxxxxxxx/
> so I thought it was flagged as a fix for the next PR. I don't see it in there:
> https://lore.kernel.org/lkml/20260313151434.1695228-1-acme@xxxxxxxxxx/
> Could we get it in?

So, I applied the one Leo pointed out and got this:

root@number:~# perf stat sleep 1

Performance counter stats for 'sleep 1':

1 context-switches # 3509.1 cs/sec cs_per_second
0 cpu-migrations # 0.0 migrations/sec migrations_per_second
75 page-faults # 263181.0 faults/sec page_faults_per_second
0.28 msec task-clock # 0.0 CPUs CPUs_utilized
8,018 branch-misses # 4.2 % branch_miss_rate
191,108 branches # 670.6 M/sec branch_frequency
870,234 cpu-cycles # 3.1 GHz cycles_frequency
<not counted> instructions # nan instructions insn_per_cycle (0.00%)
<not counted> stalled-cycles-frontend # nan frontend_cycles_idle (0.00%)

1.001839832 seconds time elapsed

0.000727000 seconds user
0.000000000 seconds sys


Some events weren't counted. Try disabling the NMI watchdog:
echo 0 > /proc/sys/kernel/nmi_watchdog
perf stat ...
echo 1 > /proc/sys/kernel/nmi_watchdog
root@number:~# echo 0 > /proc/sys/kernel/nmi_watchdog


Which is strange, in the past (see below) instructions and
stalled-cycles-frontend were counted in the default (no -e) 'perf stat'
set of events, now if I disable the nmi_watchdog I get 'instructions'
back, but not 'stalled-cycles-frontend':


root@number:~# perf stat sleep 1

Performance counter stats for 'sleep 1':

1 context-switches # 6524.7 cs/sec cs_per_second
0 cpu-migrations # 0.0 migrations/sec migrations_per_second
71 page-faults # 463256.0 faults/sec page_faults_per_second
0.15 msec task-clock # 0.0 CPUs CPUs_utilized
7,484 branch-misses # 4.0 % branch_miss_rate
186,108 branches # 1214.3 M/sec branch_frequency
810,475 cpu-cycles # 5.3 GHz cycles_frequency
893,290 instructions # 1.1 instructions insn_per_cycle
<not counted> stalled-cycles-frontend # nan frontend_cycles_idle (0.00%)

1.000382345 seconds time elapsed

0.000443000 seconds user
0.000000000 seconds sys


If I go back to v6.18 (will try a bisect to see exactly where this
happens), I get the events above, with a different printing order, but
'instructions' and 'stalled-cycles-frontend' successfully counts:

root@number:~# perf -v
perf version 6.18.g7d0a66e4bb90
root@number:~# perf stat sleep 1

Performance counter stats for 'sleep 1':

202,103 task-clock # 0.000 CPUs utilized
1 context-switches # 4.948 K/sec
0 cpu-migrations # 0.000 /sec
71 page-faults # 351.306 K/sec
895,485 instructions # 0.85 insn per cycle
# 0.56 stalled cycles per insn
1,048,898 cycles # 5.190 GHz
504,794 stalled-cycles-frontend # 48.13% frontend cycles idle
186,002 branches # 920.333 M/sec
7,857 branch-misses # 4.22% of all branches

1.000537221 seconds time elapsed

0.000542000 seconds user
0.000000000 seconds sys


root@number:~#

Trying bisection now.

- Arnaldo