linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: arm_cspmu: Reject events meant for other PMUs
@ 2023-11-03  0:16 Ilkka Koskinen
  2023-11-03  2:14 ` Besar Wicaksono
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ilkka Koskinen @ 2023-11-03  0:16 UTC (permalink / raw)
  To: Besar Wicaksono, Suzuki K Poulose, Robin Murphy, Will Deacon,
	Mark Rutland, Raag Jadav, Ilkka Koskinen
  Cc: linux-arm-kernel, linux-kernel

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: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver")
Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
---
 drivers/perf/arm_cspmu/arm_cspmu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
index 42b72042f6b3..2cc35dded007 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).
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-08 20:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-03  0:16 [PATCH] perf: arm_cspmu: Reject events meant for other PMUs Ilkka Koskinen
2023-11-03  2:14 ` Besar Wicaksono
2023-11-03  6:55 ` Anshuman Khandual
2023-11-03 11:37 ` Mark Rutland
2023-11-07 10:50 ` Will Deacon
2023-11-07 14:17 ` Catalin Marinas
2023-11-07 22:12   ` Ilkka Koskinen
2023-11-08 10:05     ` Catalin Marinas
2023-11-08 19:00       ` Ilkka Koskinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).