I’ve managed to get perf working for Unmatched PMU in linux.
The most recent OpenSBI needs to be patched, also Linux patches from Atish Patra are needed with a single patch (if you need firmware insret/cycle spent in M-Mode only).
Feel free to grab patches from:
- GitHub - YADRO-KNS/opensbi at yadro/unmatched/pmu - OpenSBI
- Commits · YADRO-KNS/linux · GitHub - Linux (with Unmatched patches applied, tested on Unmatched)
Original Linux Kernel patch series:
perf list new (with patches applied):
branch-instructions OR branches [Hardware event] branch-misses [Hardware event] bus-cycles [Hardware event] cache-misses [Hardware event] cache-references [Hardware event] cpu-cycles OR cycles [Hardware event] instructions [Hardware event] ref-cycles [Hardware event] stalled-cycles-backend OR idle-cycles-backend [Hardware event] stalled-cycles-frontend OR idle-cycles-frontend [Hardware event]
The reason for OpenSBI patches is that it is currently relying on mscountinhibit, that is absent on U740 Unmatched, i don’t see any real need for such a strict check.
Looking forward for comments.