I have a Raspberry Pi 3 with Linux. The RPi3 has a quad-core cortex-A53, with a Performace Monitoring Unit (PMU) v3. I execute the cyclictest program to do some real-time test. Cyclcitest is an aplication where you can set the period and the number of iterations and calculates the latency. Therefore, it does some executions and after it goes to sleep until the nex period, when system wakes it up.
I want to read the cache memory values in each cyclictest execution, to see how many cache misses does it have while it is executing (I do not want the misses when the task is in sleep).
I have tried with perf stat executing:
perf stat -o result1.txt -r 10 -i -e armv8_pmuv3/l1d_cache/
-e armv8_pmuv3/l1d_cache_refill/
-e armv8_pmuv3/l1d_cache_wb/
-e armv8_pmuv3/l1d_tlb_refill/
-e armv8_pmuv3/l1i_cache/
-e armv8_pmuv3/l1i_cache_refill/
-e armv8_pmuv3/l1i_tlb_refill/
-e armv8_pmuv3/l2d_cache/
-e armv8_pmuv3/l2d_cache_refill/
-e armv8_pmuv3/l2d_cache_wb/
-e armv8_pmuv3/mem_access/
cyclictest -l57600 -m -n -t1 -p80 -i50000 -h300 -q --histfile=666_data_50
However, it does provide the information around the 50% of the execution:
Performance counter stats for 'cyclictest -l57600 -m -n -t1 -p80 -i50000 -h300 -q --histfile=666_data_50' (10 runs):
937729229 armv8_pmuv3/l1d_cache/ ( +- 2.41% ) (54.50%)
44736600 armv8_pmuv3/l1d_cache_refill/ ( +- 2.33% ) (54.39%)
44784430 armv8_pmuv3/l1d_cache_wb/ ( +- 2.11% ) (54.33%)
294033 armv8_pmuv3/l1d_tlb_refill/ ( +- 13.82% ) (54.21%)
1924752301 armv8_pmuv3/l1i_cache/ ( +- 2.37% ) (54.41%)
120581610 armv8_pmuv3/l1i_cache_refill/ ( +- 2.41% ) (54.46%)
761651 armv8_pmuv3/l1i_tlb_refill/ ( +- 4.87% ) (54.70%)
215103404 armv8_pmuv3/l2d_cache/ ( +- 2.28% ) (54.69%)
30884575 armv8_pmuv3/l2d_cache_refill/ ( +- 1.44% ) (54.83%)
11424917 armv8_pmuv3/l2d_cache_wb/ ( +- 2.03% ) (54.76%)
943041718 armv8_pmuv3/mem_access/ ( +- 2.41% ) (54.74%)
2904.940283006 seconds time elapsed ( +- 0.07% )
I do not know if this counter only counts the cache information of this task while is running, or it also counts when it is in sleep. Does someone know? I have other applications running also, could they modify the value of these counters as I have specified in perf stat?
If it is not possible to read the exact value of the counter that just the task had in running? With a module or a custom user-space application?
Thank you!!