Commit cafa780e authored by Andrew Murray's avatar Andrew Murray Committed by Ingo Molnar

perf/core, arch/arm: Use PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs

For drivers that do not support context exclusion let's advertise the
PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
prevent us from handling events where any exclusion flags are set.
Let's also remove the now unnecessary check for exclusion flags.
Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarShawn Guo <shawnguo@kernel.org>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: robin.murphy@arm.com
Cc: suzuki.poulose@arm.com
Link: https://lkml.kernel.org/r/1547128414-50693-7-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 1d899c0e
...@@ -294,13 +294,7 @@ static int mmdc_pmu_event_init(struct perf_event *event) ...@@ -294,13 +294,7 @@ static int mmdc_pmu_event_init(struct perf_event *event)
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (event->attr.exclude_user || if (event->attr.sample_period)
event->attr.exclude_kernel ||
event->attr.exclude_hv ||
event->attr.exclude_idle ||
event->attr.exclude_host ||
event->attr.exclude_guest ||
event->attr.sample_period)
return -EINVAL; return -EINVAL;
if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS) if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS)
...@@ -456,6 +450,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, ...@@ -456,6 +450,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
.start = mmdc_pmu_event_start, .start = mmdc_pmu_event_start,
.stop = mmdc_pmu_event_stop, .stop = mmdc_pmu_event_stop,
.read = mmdc_pmu_event_update, .read = mmdc_pmu_event_update,
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
}, },
.mmdc_base = mmdc_base, .mmdc_base = mmdc_base,
.dev = dev, .dev = dev,
......
...@@ -314,14 +314,6 @@ static int l2x0_pmu_event_init(struct perf_event *event) ...@@ -314,14 +314,6 @@ static int l2x0_pmu_event_init(struct perf_event *event)
event->attach_state & PERF_ATTACH_TASK) event->attach_state & PERF_ATTACH_TASK)
return -EINVAL; return -EINVAL;
if (event->attr.exclude_user ||
event->attr.exclude_kernel ||
event->attr.exclude_hv ||
event->attr.exclude_idle ||
event->attr.exclude_host ||
event->attr.exclude_guest)
return -EINVAL;
if (event->cpu < 0) if (event->cpu < 0)
return -EINVAL; return -EINVAL;
...@@ -544,6 +536,7 @@ static __init int l2x0_pmu_init(void) ...@@ -544,6 +536,7 @@ static __init int l2x0_pmu_init(void)
.del = l2x0_pmu_event_del, .del = l2x0_pmu_event_del,
.event_init = l2x0_pmu_event_init, .event_init = l2x0_pmu_event_init,
.attr_groups = l2x0_pmu_attr_groups, .attr_groups = l2x0_pmu_attr_groups,
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
}; };
l2x0_pmu_reset(); l2x0_pmu_reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment