Reading hardware counter using PAPI or other tools

Hi,
I was trying to observe some CPU hardware counters(like cache miss) ( using PAPI). I could not make it work.

./papi_component_avail shows the following error:

Name: perf_event Linux perf_event CPU counters
-> Disabled: Unknown libpfm4 related error

I found that Papi does not work with all arm CPUs.
Any idea, how one could measure those hardware counters. For example, l1,l2,l3 cache misses.

Thanks.

Try lscpu or the check the /sys/devices/system/cpu/cpu*/…

Hi ShaneCCC,
lscpu only provides the cache sizes and /sys/devices/system/cpu/cpu*/ has lots of files in it. Could you please be more specific?
Is there any nvprof like tool for this caramel CPUs in Xavier?
Unfortunately, PAPI does not seems to support this particular CPU.

Could you show what PAPI show on any others platform.

Hi ShaneCC,

The Carmel CPU in Xavier has 3 levels of cache.
But If I use perf list. It only shows the first level cache. How can I measure the last level cache
miss rate?

sudo perf list |grep cache

cache-misses [Hardware event]
cache-references [Hardware event]
L1-dcache-load-misses [Hardware cache event]
L1-dcache-loads [Hardware cache event]
L1-dcache-store-misses [Hardware cache event]
L1-dcache-stores [Hardware cache event]
L1-icache-load-misses [Hardware cache event]
L1-icache-loads [Hardware cache event]
branch-load-misses [Hardware cache event]
branch-loads [Hardware cache event]
dTLB-load-misses [Hardware cache event]
iTLB-load-misses [Hardware cache event]
armv8_pmuv3/l1d_cache/ [Kernel PMU event]
armv8_pmuv3/l1d_cache_refill/ [Kernel PMU event]
armv8_pmuv3/l1d_cache_wb/ [Kernel PMU event]
armv8_pmuv3/l1i_cache/ [Kernel PMU event]
armv8_pmuv3/l1i_cache_refill/ [Kernel PMU event]
ext4:ext4_es_cache_extent [Tracepoint event]
ext4:ext4_ext_in_cache [Tracepoint event]
ext4:ext4_ext_put_in_cache [Tracepoint event]
filemap:mm_filemap_add_to_page_cache [Tracepoint event]
filemap:mm_filemap_delete_from_page_cache [Tracepoint event]
kmem:kmem_cache_alloc [Tracepoint event]
kmem:kmem_cache_alloc_node [Tracepoint event]
kmem:kmem_cache_free [Tracepoint event]
nvmap:nvmap_cache_flush [Tracepoint event]
nvmap:nvmap_cache_maint [Tracepoint event]
nvmap:pp_clean_cache [Tracepoint event]
regmap:regcache_drop_region [Tracepoint event]
regmap:regcache_sync [Tracepoint event]
regmap:regmap_cache_bypass [Tracepoint event]
regmap:regmap_cache_only [Tracepoint event]
regmap:regmap_reg_read_cache [Tracepoint event]

As I was able to get some value using perf. I am closing this thread. However, I have some perf specific question. So I will open a separate thread. Thanks for your response.