Skip to content

Commit

Permalink
drivers: perf: added capabilities for legacy PMU
Browse files Browse the repository at this point in the history
[ Upstream commit 65730fe ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
vdsh-sc authored and gregkh committed Mar 6, 2024
1 parent 50a6302 commit 97ab1dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/perf/riscv_pmu_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,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);
}
Expand Down

0 comments on commit 97ab1dc

Please sign in to comment.