I'm trying to use perf to measure certain events, including L1-dcache-stores, on my machine, which has a relatively new processor i9-10900K compared to the relatively old CentOS 7 with kernel 3.10.0-1127
The problem is that perf reports that L1-dcache-stores, together with some other events, is not supported when I run perf stat -e L1-dcache-stores
, so I can't use it, at least in a straightforward way that I know. However, under CentOS 8 with kernel 4.18.0-193, perf works fine for this event on the same machine. So, I suspect it is because the older kernel doesn't know how to deal with certain performance counters on processors that are too new, and perf is essentially part of the kernel.
What can I do to use perf on the CentOS 7 system and have things like L1-dcache-stores working properly for my processor? I can't just take the perf binary from CentOS 8 and use it on CentOS 7 because the glibc version is different.
$ sudo perf stat -e L1-dcache-stores echo
Performance counter stats for 'echo':
<not supported> L1-dcache-stores
0.000486304 seconds time elapsed
0.000389000 seconds user
0.000000000 seconds sys