0

I am trying to profile my program using perf tool in Ubuntu on my Odroid XU4 hardware. In the perf list, I can see that cache-references and cache-misses are listed but when I use the following command to profile a "Hello, World" program I am getting for cache-reference and cache-misses in the output.

perf stat -e task-clock,cache-references,cache-misses ./hello_test

Output:

 Performance counter stats for './hello_test':
 
 2.148792 task-clock # 0.507 CPUs utilized
  <not supported> cache-reference
  <not supported> cache-misses
 
 0.004239260 seconds time elapsed

I went through this solution: Why doesn't perf report cache misses? but I didn't get my answer on why cache-reference and cache-misses are not available for my hardware? And, how I can make them available?

Somdip Dey
  • 3,346
  • 6
  • 28
  • 60
  • Use `perf list` to see what events are supposed to be supported. Also try `perf stat -dd ./test` for some common events. `cache-references` (plural) is one of perf's generic events, but `cache-reference` (singular) isn't. – Peter Cordes Aug 16 '22 at 07:30
  • @PeterCordes Apologies. I mistyped. It's Cache-References. It is available under the perf list but when I try to profile it, it's coming as – Somdip Dey Aug 16 '22 at 07:52
  • Have a look at your kernel log messages to see if it says anything about what performance-counting hardware exists / is detected by the kernel. It's also *possible* that permissions are a problem, so perhaps try as root, and if that works then adjust `/proc/sys/kernel/perf_event_paranoid` (`0` is a good setting) so you can use it from user-space. If not, IDK, possibly your ARM(?) CPU doesn't support that event. Supported hardware events are specific to the microarchitecture, so different ARM CPUs might or might not be able to count different events. – Peter Cordes Aug 16 '22 at 08:06

0 Answers0