Folks,
I am trying to run linux 'perf' on a new board with 2 ARM cortex-a9 CPUs. After compiling the kernel to include perf tool, i run 'perf stat true' and it returns valid stats. But when I run 'perf record' to profile my program, it doesn't record any samples. Also, running the following command gives me an error.
# perf record -e cycles:u,cycles:k,instructions:u,instructions:k -p 1 Error:PMU Hardware doesn't support sampling/overflow-interrupts.
This makes me suspect that PMU is not initialized. Can someone suggest me how to go about this issue?
# perf stat true Performance counter stats for 'true': 1.101860 task-clock (msec) # 0.523 CPUs utilized 0 context-switches # 0.000 K/sec 0 cpu-migrations # 0.000 K/sec 22 page-faults # 0.020 M/sec 1094830 cycles # 0.994 GHz 314416 instructions # 0.29 insn per cycle 29305 branches # 26.596 M/sec 16522 branch-misses # 56.38% of all branches 0.002106000 seconds time elapsed
Then it might be that the PMU interrupt is not implemented in your SoC, but it is a bit early to be sure as it could also be not supported by your software.
You might want to look in your dmesg for a line similar to:
[ 1.714690] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
You might want to have a look at your SoC dts for mentions of the PMU interrupt.
For example, this is how it is described for the Juno SoC:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/arm/juno-r2.dts?h=v4.17-rc5#n204