In perf manual, I find two metrics to obtain llc misses:
PERF_COUNT_HW_CACHE_MISSES Cache misses.
Usually this indicates Last Level Cache misses;
PERF_COUNT_HW_CACHE_LL
for measuring Last-Level Cache
PERF_COUNT_HW_CACHE_OP_READ
for read accesses
PERF_COUNT_HW_CACHE_OP_WRITE
for write accesses
PERF_COUNT_HW_CACHE_OP_PREFETCH
for prefetch accesses
I use perf to obtain the two metrics(respectively cache-misses and LLC-load-misses), but there seems to be large difference. Which is the right answer? or any other metrics?
$sudo perf stat --timeout 10000 -e instructions,cache-references,cache-misses,LLC-loads,LLC-load-misses,LLC-store,LLC-store-misses -G kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1
Performance counter stats for 'system wide':
957,616,348,042 instructions kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 (27.33%)
2,385,485,978 cache-references kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 (27.91%)
637,991,398 cache-misses kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 # 26.745 % of all cache refs (27.91%)
38,378,430 LLC-loads kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 (27.91%)
6,031,894 LLC-load-misses kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 # 15.72% of all LL-cache hits (27.79%)
1,254,043 LLC-store kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 (27.79%)
135,446 LLC-store-misses kubepods/besteffort/podeef13b4a-d2b2-427a-8219-a9af8b327cf1 (27.82%)
10.004501298 seconds time elapsed
This is my cpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 104
On-line CPU(s) list: 0-103
Thread(s) per core: 2
Core(s) per socket: 26
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
New contributor
陈青云 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.