drivers/perf: riscv_pmu_sbi: perf format
authorNikita Shubin <n.shubin@yadro.com>
Tue, 28 Jun 2022 11:45:55 +0000 (14:45 +0300)
committerWill Deacon <will@kernel.org>
Wed, 6 Jul 2022 10:06:24 +0000 (11:06 +0100)
commit26fabd6d2ffc2812138a613bec84ec72541842e7
tree2ee64cc4cc7a2e6c7492cfa702def654493837ff
parent0e35850b341e88055ca11cad74efa464b2159984
drivers/perf: riscv_pmu_sbi: perf format

Update driver to export formatting and event information to sysfs so it
can be used by the perf user space tools with the syntaxes:

perf stat -e cpu/event=0x05
perf stat -e cpu/event=0x05,firmware=0x1/

63-bit is used to distinguish hardware events from firmware. Firmware
events are defined by "RISC-V Supervisor Binary Interface
Specification".

perf stat -e cpu/event=0x05,firmware=0x1/

is equivalent to

perf stat -e r8000000000000005

Suggested-by: João Mário Domingos <joao.mario@tecnico.ulisboa.pt>
Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Link: https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/riscv-sbi.adoc
Link: https://lore.kernel.org/r/20220628114625.166665-2-nikita.shubin@maquefel.me
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/riscv_pmu_sbi.c