Ubuntu 24.04: "perf stat" reports events not counted

Hello, I am trying to sample hardware events as shown below, but for every event (such as “perf event -e LLC-loads benchmark”) I am getting “not counted” from perf. I have installed Ubuntu 24.04 on my VisionFive 2 in an NVMe drive. From previous experiments using the board with Ubuntu 23.10 perf sampling worked fine. Could be this be a problem due to the updated openSBI that I had to install in order to be able to boot Ubuntu 24.04? Thanks in advance!

List of pre-defined events (to be used in -e or -M):

  branch-instructions OR branches                    [Hardware event]
  branch-misses                                      [Hardware event]
  bus-cycles                                         [Hardware event]
  cache-misses                                       [Hardware event]
  cache-references                                   [Hardware event]
  cpu-cycles OR cycles                               [Hardware event]
  instructions                                       [Hardware event]
  ref-cycles                                         [Hardware event]
  stalled-cycles-backend OR idle-cycles-backend      [Hardware event]
  stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]

cpu:
  L1-dcache-loads OR cpu/L1-dcache-loads/
  L1-dcache-load-misses OR cpu/L1-dcache-load-misses/
  L1-dcache-stores OR cpu/L1-dcache-stores/
  L1-dcache-store-misses OR cpu/L1-dcache-store-misses/
  L1-dcache-prefetches OR cpu/L1-dcache-prefetches/
  L1-dcache-prefetch-misses OR cpu/L1-dcache-prefetch-misses/
  L1-icache-loads OR cpu/L1-icache-loads/
  L1-icache-load-misses OR cpu/L1-icache-load-misses/
  L1-icache-prefetches OR cpu/L1-icache-prefetches/
  L1-icache-prefetch-misses OR cpu/L1-icache-prefetch-misses/
  LLC-loads OR cpu/LLC-loads/
  LLC-load-misses OR cpu/LLC-load-misses/
  LLC-stores OR cpu/LLC-stores/
  LLC-store-misses OR cpu/LLC-store-misses/
  LLC-prefetches OR cpu/LLC-prefetches/
  LLC-prefetch-misses OR cpu/LLC-prefetch-misses/
  dTLB-loads OR cpu/dTLB-loads/
  dTLB-load-misses OR cpu/dTLB-load-misses/
  dTLB-stores OR cpu/dTLB-stores/
  dTLB-store-misses OR cpu/dTLB-store-misses/
  dTLB-prefetches OR cpu/dTLB-prefetches/
  dTLB-prefetch-misses OR cpu/dTLB-prefetch-misses/
  iTLB-loads OR cpu/iTLB-loads/
  iTLB-load-misses OR cpu/iTLB-load-misses/
  branch-loads OR cpu/branch-loads/
  branch-load-misses OR cpu/branch-load-misses/
1 Like