diff options
author | Mark Rutland <mark.rutland@arm.com> | 2011-04-27 11:22:21 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2011-08-31 05:50:01 -0400 |
commit | 7b9f72c62ed047a200b1ef8c70bee0b58e880af8 (patch) | |
tree | 1858fa358eaf3a40d892ff86705b724f1be8c3c7 /arch/arm | |
parent | 48957155f8791964d8567479e6986f88343aba38 (diff) |
ARM: perf: clean up event group validation
Currently, event group validation compares each event's 'pmu' pointer
against the static 'pmu' pointer. This limits the code to supporting
only 1 PMU.
This patch changes the behaviour to consider an event's group leader's
'pmu' pointer as canonical for validation. This should ease later
generalisation of the code to support multiple PMUs at once.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Ashwin Chaugule <ashwinc@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/perf_event.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 753648cf9af6..dfde9283aec1 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -348,8 +348,9 @@ validate_event(struct cpu_hw_events *cpuc, | |||
348 | struct perf_event *event) | 348 | struct perf_event *event) |
349 | { | 349 | { |
350 | struct hw_perf_event fake_event = event->hw; | 350 | struct hw_perf_event fake_event = event->hw; |
351 | struct pmu *leader_pmu = event->group_leader->pmu; | ||
351 | 352 | ||
352 | if (event->pmu != &pmu || event->state <= PERF_EVENT_STATE_OFF) | 353 | if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF) |
353 | return 1; | 354 | return 1; |
354 | 355 | ||
355 | return armpmu->get_event_idx(cpuc, &fake_event) >= 0; | 356 | return armpmu->get_event_idx(cpuc, &fake_event) >= 0; |