aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2013-08-20 11:47:41 +0100
committerMark Brown <broonie@linaro.org>2014-05-14 12:15:48 +0100
commit0d7707cb914db6188e9041e4a4440687a3f89ddf (patch)
tree5f41c1da4ad96714d17fcc9991c284b650b89bda
parent4281a11a7e44655baa41241c470b09d4fae4be35 (diff)
downloadlinux-linaro-stable-0d7707cb914db6188e9041e4a4440687a3f89ddf.tar.gz
arm64: perf: fix group validation when using enable_on_exec
commit 8455e6ec70f33b0e8c3ffd47067e00481f09f454 upstream. This is a port of cb2d8b342aa0 ("ARM: 7698/1: perf: fix group validation when using enable_on_exec") to arm64, which fixes the event validation checking so that events in the OFF state are still considered when enable_on_exec is true. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 1f96d83b38937294584ede9473c2b2961528f287) Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--arch/arm64/kernel/perf_event.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 12e6ccb88691..2a1e9163d67a 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -325,7 +325,10 @@ validate_event(struct pmu_hw_events *hw_events,
if (is_software_event(event))
return 1;
- if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF)
+ if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
+ return 1;
+
+ if (event->state == PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)
return 1;
return armpmu->get_event_idx(hw_events, &fake_event) >= 0;