Skip to content

Commit 15c7ef7

Browse files
ilkka-koskinenctmarinas
authored andcommitted
perf: arm_cspmu: Reject events meant for other PMUs
Coresight PMU driver didn't reject events meant for other PMUs. This caused some of the Core PMU events disappearing from the output of "perf list". In addition, trying to run e.g. $ perf stat -e r2 sleep 1 made Coresight PMU driver to handle the event instead of letting Core PMU driver to deal with it. Cc: stable@vger.kernel.org Fixes: e37dfd6 ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Acked-by: Will Deacon <will@kernel.org> Reviewed-by: Besar Wicaksono <bwicaksono@nvidia.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Link: https://lore.kernel.org/r/20231103001654.35565-1-ilkka@os.amperecomputing.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 6eeeb4c commit 15c7ef7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/perf/arm_cspmu/arm_cspmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@ static int arm_cspmu_event_init(struct perf_event *event)
676676

677677
cspmu = to_arm_cspmu(event->pmu);
678678

679+
if (event->attr.type != event->pmu->type)
680+
return -ENOENT;
681+
679682
/*
680683
* Following other "uncore" PMUs, we do not support sampling mode or
681684
* attach to a task (per-process mode).

0 commit comments

Comments
 (0)