Message ID | de2646ca1d333cd9286f22ed3a5e8d57d22833b1.1710257512.git.robin.murphy@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | perf: Clean up common uncore boilerplate | expand |
On Tue, Mar 12, 2024 at 05:34:12PM +0000, Robin Murphy wrote: > Switch the ARM system PMU drivers over to the new common capabilities, > allowing to remove all the checks that perf core now takes care of. > > CC: Russell King <linux@armlinux.org.uk> > CC: Shawn Guo <shawnguo@kernel.org> > CC: Sascha Hauer <s.hauer@pengutronix.de> > Signed-off-by: Robin Murphy <robin.murphy@arm.com> > --- > arch/arm/mach-imx/mmdc.c | 16 +--------------- Acked-by: Shawn Guo <shawnguo@kernel.org> > arch/arm/mm/cache-l2x0-pmu.c | 12 +----------- > 2 files changed, 2 insertions(+), 26 deletions(-) > > diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c > index 444a7eaa320c..806ab6675b37 100644 > --- a/arch/arm/mach-imx/mmdc.c > +++ b/arch/arm/mach-imx/mmdc.c > @@ -280,20 +280,6 @@ static int mmdc_pmu_event_init(struct perf_event *event) > struct mmdc_pmu *pmu_mmdc = to_mmdc_pmu(event->pmu); > int cfg = event->attr.config; > > - if (event->attr.type != event->pmu->type) > - return -ENOENT; > - > - if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) > - return -EOPNOTSUPP; > - > - if (event->cpu < 0) { > - dev_warn(pmu_mmdc->dev, "Can't provide per-task data!\n"); > - return -EOPNOTSUPP; > - } > - > - if (event->attr.sample_period) > - return -EINVAL; > - > if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS) > return -EINVAL; > > @@ -445,7 +431,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, > .start = mmdc_pmu_event_start, > .stop = mmdc_pmu_event_stop, > .read = mmdc_pmu_event_update, > - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, > + .capabilities = PERF_PMU_UNCORE_CAPS, > }, > .mmdc_base = mmdc_base, > .dev = dev, > diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c > index 993fefdc167a..a2567d953fdb 100644 > --- a/arch/arm/mm/cache-l2x0-pmu.c > +++ b/arch/arm/mm/cache-l2x0-pmu.c > @@ -295,16 +295,6 @@ static int l2x0_pmu_event_init(struct perf_event *event) > { > struct hw_perf_event *hw = &event->hw; > > - if (event->attr.type != l2x0_pmu->type) > - return -ENOENT; > - > - if (is_sampling_event(event) || > - event->attach_state & PERF_ATTACH_TASK) > - return -EINVAL; > - > - if (event->cpu < 0) > - return -EINVAL; > - > if (event->attr.config & ~L2X0_EVENT_CNT_CFG_SRC_MASK) > return -EINVAL; > > @@ -524,7 +514,7 @@ static __init int l2x0_pmu_init(void) > .del = l2x0_pmu_event_del, > .event_init = l2x0_pmu_event_init, > .attr_groups = l2x0_pmu_attr_groups, > - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, > + .capabilities = PERF_PMU_UNCORE_CAPS, > }; > > l2x0_pmu_reset(); > -- > 2.39.2.101.g768bb238c484.dirty >
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 444a7eaa320c..806ab6675b37 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -280,20 +280,6 @@ static int mmdc_pmu_event_init(struct perf_event *event) struct mmdc_pmu *pmu_mmdc = to_mmdc_pmu(event->pmu); int cfg = event->attr.config; - if (event->attr.type != event->pmu->type) - return -ENOENT; - - if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) - return -EOPNOTSUPP; - - if (event->cpu < 0) { - dev_warn(pmu_mmdc->dev, "Can't provide per-task data!\n"); - return -EOPNOTSUPP; - } - - if (event->attr.sample_period) - return -EINVAL; - if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS) return -EINVAL; @@ -445,7 +431,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, .start = mmdc_pmu_event_start, .stop = mmdc_pmu_event_stop, .read = mmdc_pmu_event_update, - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, + .capabilities = PERF_PMU_UNCORE_CAPS, }, .mmdc_base = mmdc_base, .dev = dev, diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 993fefdc167a..a2567d953fdb 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -295,16 +295,6 @@ static int l2x0_pmu_event_init(struct perf_event *event) { struct hw_perf_event *hw = &event->hw; - if (event->attr.type != l2x0_pmu->type) - return -ENOENT; - - if (is_sampling_event(event) || - event->attach_state & PERF_ATTACH_TASK) - return -EINVAL; - - if (event->cpu < 0) - return -EINVAL; - if (event->attr.config & ~L2X0_EVENT_CNT_CFG_SRC_MASK) return -EINVAL; @@ -524,7 +514,7 @@ static __init int l2x0_pmu_init(void) .del = l2x0_pmu_event_del, .event_init = l2x0_pmu_event_init, .attr_groups = l2x0_pmu_attr_groups, - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, + .capabilities = PERF_PMU_UNCORE_CAPS, }; l2x0_pmu_reset();
Switch the ARM system PMU drivers over to the new common capabilities, allowing to remove all the checks that perf core now takes care of. CC: Russell King <linux@armlinux.org.uk> CC: Shawn Guo <shawnguo@kernel.org> CC: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Robin Murphy <robin.murphy@arm.com> --- arch/arm/mach-imx/mmdc.c | 16 +--------------- arch/arm/mm/cache-l2x0-pmu.c | 12 +----------- 2 files changed, 2 insertions(+), 26 deletions(-)