Skip to content

Commit 65730fe

Browse files
vdsh-scpalmer-dabbelt
authored andcommitted
drivers: perf: added capabilities for legacy PMU
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@rivosinc.com> Signed-off-by: Vadim Shakirov <vadim.shakirov@syntacore.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Fixes: 9b3e150 ("RISC-V: Add a simple platform driver for RISC-V legacy perf") Link: https://lore.kernel.org/r/20240227170002.188671-2-vadim.shakirov@syntacore.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 6613476 commit 65730fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/perf/riscv_pmu_legacy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ static void pmu_legacy_init(struct riscv_pmu *pmu)
117117
pmu->event_mapped = pmu_legacy_event_mapped;
118118
pmu->event_unmapped = pmu_legacy_event_unmapped;
119119
pmu->csr_index = pmu_legacy_csr_index;
120+
pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
121+
pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE;
120122

121123
perf_pmu_register(&pmu->pmu, "cpu", PERF_TYPE_RAW);
122124
}

0 commit comments

Comments
 (0)