Skip to content

Commit

Permalink
perf: arm_cspmu: Reject events meant for other PMUs
Browse files Browse the repository at this point in the history
commit 15c7ef7 upstream.

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: e37dfd6 ("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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ilkka-koskinen authored and gregkh committed Nov 28, 2023
1 parent 10f49cd commit 1fd3a0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/perf/arm_cspmu/arm_cspmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,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).
Expand Down

0 comments on commit 1fd3a0b

Please sign in to comment.