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

From: David Arcari

Date: Tue Apr 14 2026 - 09:55:25 EST


kernel is a Fedora version of 7.0.0-0.rc4

I have two ADL systems that exhibit the same behavior.

# grep . /sys/devices/cpu_core/events/*
/sys/devices/cpu_core/events/branch-instructions:event=0xc4
/sys/devices/cpu_core/events/branch-misses:event=0xc5
/sys/devices/cpu_core/events/bus-cycles:event=0x3c,umask=0x01
/sys/devices/cpu_core/events/cache-misses:event=0x2e,umask=0x41
/sys/devices/cpu_core/events/cache-references:event=0x2e,umask=0x4f
/sys/devices/cpu_core/events/cpu-cycles:event=0x3c
/sys/devices/cpu_core/events/instructions:event=0xc0
/sys/devices/cpu_core/events/mem-loads:event=0xcd,umask=0x1,ldlat=3
/sys/devices/cpu_core/events/mem-loads-aux:event=0x03,umask=0x82
/sys/devices/cpu_core/events/mem-stores:event=0xcd,umask=0x2
/sys/devices/cpu_core/events/ref-cycles:event=0x3c,umask=0x01
/sys/devices/cpu_core/events/slots:event=0x00,umask=0x4
/sys/devices/cpu_core/events/topdown-bad-spec:event=0x00,umask=0x81
/sys/devices/cpu_core/events/topdown-be-bound:event=0x00,umask=0x83
/sys/devices/cpu_core/events/topdown-br-mispredict:event=0x00,umask=0x85
/sys/devices/cpu_core/events/topdown-fe-bound:event=0x00,umask=0x82
/sys/devices/cpu_core/events/topdown-fetch-lat:event=0x00,umask=0x86
/sys/devices/cpu_core/events/topdown-heavy-ops:event=0x00,umask=0x84
/sys/devices/cpu_core/events/topdown-mem-bound:event=0x00,umask=0x87
/sys/devices/cpu_core/events/topdown-retiring:event=0x00,umask=0x80

# grep . /sys/devices/cpu_atom/events/*
/sys/devices/cpu_atom/events/branch-instructions:event=0xc4
/sys/devices/cpu_atom/events/branch-misses:event=0xc5
/sys/devices/cpu_atom/events/bus-cycles:event=0x3c,umask=0x01
/sys/devices/cpu_atom/events/cache-misses:event=0x2e,umask=0x41
/sys/devices/cpu_atom/events/cache-references:event=0x2e,umask=0x4f
/sys/devices/cpu_atom/events/cpu-cycles:event=0x3c
/sys/devices/cpu_atom/events/instructions:event=0xc0
grep: /sys/devices/cpu_atom/events/mem-loads: binary file matches
grep: /sys/devices/cpu_atom/events/mem-stores: binary file matches
/sys/devices/cpu_atom/events/ref-cycles:event=0x3c,umask=0x01
grep: /sys/devices/cpu_atom/events/topdown-bad-spec: binary file matches
grep: /sys/devices/cpu_atom/events/topdown-be-bound: binary file matches
grep: /sys/devices/cpu_atom/events/topdown-fe-bound: binary file matches
grep: /sys/devices/cpu_atom/events/topdown-retiring: binary file matches



On 4/13/26 9:22 PM, Mi, Dapeng1 wrote:
It looks strange. Suppose cache-misses event doesn't need to assign the offcore_rsp field. Could you please run below commands ?

grep . /sys/devices/cpu_core/events/*
grep . /sys/devices/cpu_atom/events/*

BTW, which kernel did you use? I would find a ADL and check if it can be reproduced. Thanks.

------------------------------------------------------------------------
*From:* David Arcari <darcari@xxxxxxxxxx>
*Sent:* Monday, April 13, 2026 7:53 PM
*To:* Mi, Dapeng1 <dapeng1.mi@xxxxxxxxx>; Len Brown <lenb@xxxxxxxxxx>
*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


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