[PATCH 2/2] drivers: perf: added capabilities for legacy PMU
Vadim Shakirov
vadim.shakirov at syntacore.com
Tue Dec 5 01:25:55 PST 2023
Added the PERF_PMU_CAP_NO_INTERRUPT flag because the legacy pmu driver
does not provide sampling capabilities
Added the PERF_PMU_CAP_NO_EXCLUDE flag because the legacy pmu driver
does not provide the ability to disable counter incrementation in
different privilege modes
Suggested-by: Atish Patra <atishp at atishpatra.org>
Signed-off-by: Vadim Shakirov <vadim.shakirov at syntacore.com>
---
drivers/perf/riscv_pmu_legacy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/perf/riscv_pmu_legacy.c b/drivers/perf/riscv_pmu_legacy.c
index a179ed6ac980..fa0bccf4edf2 100644
--- a/drivers/perf/riscv_pmu_legacy.c
+++ b/drivers/perf/riscv_pmu_legacy.c
@@ -123,6 +123,8 @@ static void pmu_legacy_init(struct riscv_pmu *pmu)
pmu->event_mapped = pmu_legacy_event_mapped;
pmu->event_unmapped = pmu_legacy_event_unmapped;
pmu->csr_index = pmu_legacy_csr_index;
+ pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
+ pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE;
perf_pmu_register(&pmu->pmu, "cpu", PERF_TYPE_RAW);
}
--
2.34.1
More information about the linux-riscv
mailing list