RISC-V: Add a simple platform driver for RISC-V legacy perf
authorAtish Patra <atish.patra@wdc.com>
Sat, 19 Feb 2022 00:46:55 +0000 (16:46 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 21 Mar 2022 21:58:25 +0000 (14:58 -0700)
commit9b3e150e310ee71d7bae1e31c38a300cfa5e951b
tree28265a280435ea8c707d06c1a6e1255a1b44ffe7
parentf5bfa23f576fdcc8e0b7fbff44cf70bd69ff9bdb
RISC-V: Add a simple platform driver for RISC-V legacy perf

The old RISC-V perf implementation allowed counting of only
cycle/instruction counters using perf. Restore that feature by implementing
a simple platform driver under a separate config to provide backward
compatibility. Any existing software stack will continue to work as it is.
However, it provides an easy way out in future where we can remove the
legacy driver.

Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/perf/Kconfig
drivers/perf/Makefile
drivers/perf/riscv_pmu_legacy.c [new file with mode: 0644]
include/linux/perf/riscv_pmu.h