Status update:
- all OpenSBI stuff is merged to master (dropped my firmware counters currently)
- linux latest v4 PMU + latest v2 patches for raw events pretty names:
Improve RISC-V Perf support using SBI PMU and sscofpmf extension
Introduce pmu-events support for HiFive Unmatched - bindings from general/cache Linux perf events to Unmatched HPM according this table:
Perf list to FU740 HPM bindings question
riscv: dts: Add HPM events · YADRO-KNS/u-boot@2ce6f40 · GitHub
Feel free to grab branches with applied patches from:
U-Boot: GitHub - YADRO-KNS/u-boot at yadro/riscv/unmatched-v2021.07
Linux (v5.16-rc6): Commits · YADRO-KNS/linux · GitHub
Qemu (rebased on the top of v6.1.0): Commits · maquefel/qemu · GitHub
# perf stat sleep 1
Performance counter stats for 'sleep 1':
1.23 msec task-clock # 0.001 CPUs utilized
1 context-switches # 815.661 /sec
0 cpu-migrations # 0.000 /sec
45 page-faults # 36.705 K/sec
1468356 cycles # 1.198 GHz
508982 instructions # 0.35 insn per cycle
69255 branches # 56.489 M/sec
25223 branch-misses # 36.42% of all branches
1.002246000 seconds time elapsed
0.002639000 seconds user
0.000000000 seconds sys
Now displayed correctly see table.
You still can’t and it won’t be possible to use sampling (perf record, perf top) with hardware counters as leader, but error is now displayed correctly:
# perf record
Error:
cycles: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'
Still you can record with task-clock, cpu-clock (or any software counter) as leaders - if it useful for you, i.e.:
# perf record -e '{cpu-clock,cycles,instructions,branches}:s' sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.003 MB perf.data (36 samples) ]
And even build flame graphs with -g.
Please give feedback on this table Perf list to FU740 HPM bindings question