Re: [PATCH] tools/power turbostat: Allow execution to continue after perf_l2_init() failure

From: David Arcari

Date: Mon Apr 13 2026 - 07:54:00 EST



Here is the -vvv output:

# sudo perf stat -e cache-misses -vvv sleep 1
Control descriptor is not initialized
Opening: cache-misses
------------------------------------------------------------
perf_event_attr:
type 10 (cpu_atom)
size 144
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'ldlat' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
unknown term 'offcore_rsp' for pmu 'cpu_atom' (valid terms: event,pc,edge,inv,umask,cmask,config,config1,config2,config3,config4,name,period,percore,metric-id,cpu)
config 0x412e (cache-misses)
sample_type IDENTIFIER
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
inherit 1
enable_on_exec 1
------------------------------------------------------------
sys_perf_event_open: pid 9255 cpu -1 group_fd -1 flags 0x8
sys_perf_event_open failed, error -12
Warning:
skipping event cache-misses that kernel failed to open.
The sys_perf_event_open() syscall failed for event (cache-misses): Cannot allocate memory
"dmesg | grep -i perf" may provide additional information.

Opening: cache-misses
------------------------------------------------------------
perf_event_attr:
type 4 (cpu_core)
size 144
config 0x412e (cache-misses)
sample_type IDENTIFIER
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
inherit 1
enable_on_exec 1
------------------------------------------------------------
sys_perf_event_open: pid 9255 cpu -1 group_fd -1 flags 0x8 = 3
cache-misses: -1: 11224 321150 321150
failed to read counter cache-misses
cache-misses: 11224 321150 321150

Performance counter stats for 'sleep 1':

<not supported> cpu_atom/cache-misses/
11,224 cpu_core/cache-misses/

1.003110088 seconds time elapsed

0.000000000 seconds user
0.000846000 seconds sys


On 4/12/26 8:34 PM, Mi, Dapeng1 wrote:
The most possible reason for the "<not supported>" is that the "sleep 1" process runs on a P-core where "cpu_atom/cache-misses/" can't be supported. It's expected.

BTW, you can add "-vvv" option which gives more details like "sudo perf stat -e cache-misses -vvv sleep 1".

Thanks.

------------------------------------------------------------------------
*From:* Len Brown <lenb@xxxxxxxxxx>
*Sent:* Saturday, April 11, 2026 2:09 AM
*To:* Arcari, David <darcari@xxxxxxxxxx>; Mi, Dapeng1 <dapeng1.mi@xxxxxxxxx>
*Cc:* Linux PM list <linux-pm@xxxxxxxxxxxxxxx>; Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>
*Subject:* Re: [PATCH] tools/power turbostat: Allow execution to continue after perf_l2_init() failure

On Fri, Apr 10, 2026 at 12:06 PM David Arcari <darcari@xxxxxxxxxx> wrote:

> I'm using a Fedora kernel:
>
> vmlinuz-7.0.0-0.rc4.260320g0e4f8f1a3d08.40.eln155.x86_64
>
> And turbostat is:
>
> # turbostat -v
> turbostat version 2026.02.14 - Len Brown <lenb@xxxxxxxxxx>
>
> >
> > You can poke with "perf stat" as well, but this will depend on what
> > .json counter list is compiled into
> > your version of perf.
> >
> > probably a first sanity check would be if these commands for the LLC
> > and the L2 work:
> >
> > sudo perf stat -e cache-misses sleep 1
> > sudo perf stat -e L2_REQUEST.ALL sleep 1
>
> # sudo perf stat -e cache-misses sleep 1
>
>   Performance counter stats for 'sleep 1':
>
>     <not supported>      cpu_atom/cache-misses/

I think this should work.  There may be an issue either with
the perf utility or the perf kernel support on that system.

I'll cc Dapeng.  Already the weekend where he is, but maybe he
can give us some perf insight next week.

thx,
-Len