RISC-V: Add a simple platform driver for RISC-V legacy perf
authorAtish Patra <atish.patra@wdc.com>
Wed, 17 Mar 2021 23:31:46 +0000 (16:31 -0700)
committerminda.chen <minda.chen@starfivetech.com>
Tue, 3 Jan 2023 06:26:17 +0000 (14:26 +0800)
commit42b683064d64a6c52ad909af6aaf1bf01315d634
tree4ed5ea083889170e0199b936fc85168fdfc671a6
parent2680fe9e03431db972812ef12ca1b7eb931792ad
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>
drivers/perf/Kconfig
drivers/perf/Makefile
drivers/perf/riscv_pmu_legacy.c [new file with mode: 0644]
include/linux/perf/riscv_pmu.h