[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <778547b3a1c6eb907a7d775c5ac579610ea2be71.1755096883.git.robin.murphy@arm.com>
Date: Wed, 13 Aug 2025 18:01:06 +0100
From: Robin Murphy <robin.murphy@....com>
To: peterz@...radead.org,
mingo@...hat.com,
will@...nel.org,
mark.rutland@....com,
acme@...nel.org,
namhyung@...nel.org,
alexander.shishkin@...ux.intel.com,
jolsa@...nel.org,
irogers@...gle.com,
adrian.hunter@...el.com,
kan.liang@...ux.intel.com
Cc: linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-alpha@...r.kernel.org,
linux-snps-arc@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
imx@...ts.linux.dev,
linux-csky@...r.kernel.org,
loongarch@...ts.linux.dev,
linux-mips@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org,
sparclinux@...r.kernel.org,
linux-pm@...r.kernel.org,
linux-rockchip@...ts.infradead.org,
dmaengine@...r.kernel.org,
linux-fpga@...r.kernel.org,
amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org,
intel-xe@...ts.freedesktop.org,
coresight@...ts.linaro.org,
iommu@...ts.linux.dev,
linux-amlogic@...ts.infradead.org,
linux-cxl@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: [PATCH 14/19] perf: Clean up redundant group validation
None of these drivers are doing anything that perf_event_open() doesn't
inherently do as of commit bf480f938566 ("perf/core: Don't allow
grouping events from different hw pmus"). While it's quite possible
that they should be doing some actual validation of the schedulability
of their own events within the given group, for now at least removing
this redundant code makes it even clearer that they are not.
Signed-off-by: Robin Murphy <robin.murphy@....com>
---
drivers/perf/arm-ccn.c | 16 ----------------
drivers/perf/fsl_imx9_ddr_perf.c | 16 ----------------
drivers/perf/marvell_cn10k_ddr_pmu.c | 5 -----
drivers/perf/xgene_pmu.c | 15 ---------------
4 files changed, 52 deletions(-)
diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
index 1a0d0e1a2263..63549aad3b99 100644
--- a/drivers/perf/arm-ccn.c
+++ b/drivers/perf/arm-ccn.c
@@ -708,7 +708,6 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
u32 node_xp, type, event_id;
int valid;
int i;
- struct perf_event *sibling;
if (event->attr.type != event->pmu->type)
return -ENOENT;
@@ -814,21 +813,6 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
node_xp, type, port);
}
- /*
- * We must NOT create groups containing mixed PMUs, although software
- * events are acceptable (for example to create a CCN group
- * periodically read when a hrtimer aka cpu-clock leader triggers).
- */
- if (event->group_leader->pmu != event->pmu &&
- !is_software_event(event->group_leader))
- return -EINVAL;
-
- for_each_sibling_event(sibling, event->group_leader) {
- if (sibling->pmu != event->pmu &&
- !is_software_event(sibling))
- return -EINVAL;
- }
-
return 0;
}
diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c
index 267754fdf581..85874ec5ecd0 100644
--- a/drivers/perf/fsl_imx9_ddr_perf.c
+++ b/drivers/perf/fsl_imx9_ddr_perf.c
@@ -552,7 +552,6 @@ static int ddr_perf_event_init(struct perf_event *event)
{
struct ddr_pmu *pmu = to_ddr_pmu(event->pmu);
struct hw_perf_event *hwc = &event->hw;
- struct perf_event *sibling;
if (event->attr.type != event->pmu->type)
return -ENOENT;
@@ -565,21 +564,6 @@ static int ddr_perf_event_init(struct perf_event *event)
return -EOPNOTSUPP;
}
- /*
- * We must NOT create groups containing mixed PMUs, although software
- * events are acceptable (for example to create a CCN group
- * periodically read when a hrtimer aka cpu-clock leader triggers).
- */
- if (event->group_leader->pmu != event->pmu &&
- !is_software_event(event->group_leader))
- return -EINVAL;
-
- for_each_sibling_event(sibling, event->group_leader) {
- if (sibling->pmu != event->pmu &&
- !is_software_event(sibling))
- return -EINVAL;
- }
-
event->cpu = pmu->cpu;
hwc->idx = -1;
diff --git a/drivers/perf/marvell_cn10k_ddr_pmu.c b/drivers/perf/marvell_cn10k_ddr_pmu.c
index 72ac17efd846..54e3fd206d39 100644
--- a/drivers/perf/marvell_cn10k_ddr_pmu.c
+++ b/drivers/perf/marvell_cn10k_ddr_pmu.c
@@ -487,11 +487,6 @@ static int cn10k_ddr_perf_event_init(struct perf_event *event)
return -EOPNOTSUPP;
}
- /* We must NOT create groups containing mixed PMUs */
- if (event->group_leader->pmu != event->pmu &&
- !is_software_event(event->group_leader))
- return -EINVAL;
-
/* Set ownership of event to one CPU, same event can not be observed
* on multiple cpus at same time.
*/
diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c
index 33b5497bdc06..5e80ae0e692d 100644
--- a/drivers/perf/xgene_pmu.c
+++ b/drivers/perf/xgene_pmu.c
@@ -877,7 +877,6 @@ static int xgene_perf_event_init(struct perf_event *event)
{
struct xgene_pmu_dev *pmu_dev = to_pmu_dev(event->pmu);
struct hw_perf_event *hw = &event->hw;
- struct perf_event *sibling;
/* Test the event attr type check for PMU enumeration */
if (event->attr.type != event->pmu->type)
@@ -913,20 +912,6 @@ static int xgene_perf_event_init(struct perf_event *event)
*/
hw->config_base = event->attr.config1;
- /*
- * We must NOT create groups containing mixed PMUs, although software
- * events are acceptable
- */
- if (event->group_leader->pmu != event->pmu &&
- !is_software_event(event->group_leader))
- return -EINVAL;
-
- for_each_sibling_event(sibling, event->group_leader) {
- if (sibling->pmu != event->pmu &&
- !is_software_event(sibling))
- return -EINVAL;
- }
-
return 0;
}
--
2.39.2.101.g768bb238c484.dirty
Powered by blists - more mailing lists