diff options
author | Will Deacon <will.deacon@arm.com> | 2013-08-20 11:47:41 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-08-20 12:12:25 +0100 |
commit | 8455e6ec70f33b0e8c3ffd47067e00481f09f454 (patch) | |
tree | f5c7ac893fef4e781e8143d8e1f361304ce821ad /arch/arm64 | |
parent | ee7538a008a45050c8f706d38b600f55953169f9 (diff) | |
download | op-kernel-dev-8455e6ec70f33b0e8c3ffd47067e00481f09f454.zip op-kernel-dev-8455e6ec70f33b0e8c3ffd47067e00481f09f454.tar.gz |
arm64: perf: fix group validation when using enable_on_exec
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.
Cc: <stable@vger.kernel.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 12e6ccb..2a1e916 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; |