[PATCH 04/19] perf/starfive: Fix group validation
Robin Murphy
robin.murphy at arm.com
Wed Aug 13 17:00:56 UTC 2025
The group validation code here is superficially the right shape, but
is failing to count the group leader, while also erroneously counting
software siblings. Just correctly count the events which belong to our
PMU, and let perf core worry about the rest.
Signed-off-by: Robin Murphy <robin.murphy at arm.com>
---
drivers/perf/starfive_starlink_pmu.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/perf/starfive_starlink_pmu.c b/drivers/perf/starfive_starlink_pmu.c
index 5e5a672b4229..e185f307e639 100644
--- a/drivers/perf/starfive_starlink_pmu.c
+++ b/drivers/perf/starfive_starlink_pmu.c
@@ -347,19 +347,15 @@ static bool starlink_pmu_validate_event_group(struct perf_event *event)
struct perf_event *sibling;
int counter = 1;
- /*
- * Ensure hardware events in the group are on the same PMU,
- * software events are acceptable.
- */
- if (event->group_leader->pmu != event->pmu &&
- !is_software_event(event->group_leader))
- return false;
+ if (leader == event)
+ return true;
+
+ if (leader->pmu == event->pmu)
+ counter++;
for_each_sibling_event(sibling, leader) {
- if (sibling->pmu != event->pmu && !is_software_event(sibling))
- return false;
-
- counter++;
+ if (sibling->pmu == event->pmu)
+ counter++;
}
return counter <= STARLINK_PMU_NUM_COUNTERS;
--
2.39.2.101.g768bb238c484.dirty
More information about the Intel-xe
mailing list