diff options
author | Ilkka Koskinen <[email protected]> | 2023-11-02 17:16:54 -0700 |
---|---|---|
committer | Catalin Marinas <[email protected]> | 2023-11-07 11:00:49 +0000 |
commit | 15c7ef7341a2e54cfa12ac502c65d6fd2cce2b62 (patch) | |
tree | 3e0d4accde63b751c36063c8fbeb983ebeb16708 | |
parent | 6eeeb4c7e4b5e03405b335fa7ce340922b7ce089 (diff) |
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: [email protected]
Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver")
Signed-off-by: Ilkka Koskinen <[email protected]>
Acked-by: Will Deacon <[email protected]>
Reviewed-by: Besar Wicaksono <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
-rw-r--r-- | drivers/perf/arm_cspmu/arm_cspmu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c index 0e3fe00d741d..9f478f2c8554 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -676,6 +676,9 @@ static int arm_cspmu_event_init(struct perf_event *event) cspmu = to_arm_cspmu(event->pmu); + if (event->attr.type != event->pmu->type) + return -ENOENT; + /* * Following other "uncore" PMUs, we do not support sampling mode or * attach to a task (per-process mode). |