ARM: perf: fix event validation
Subsystems (3)
PATCH 1/1 ARM: perf: fix event validation
The validate_event function in the ARM perf events backend has the following problems:
1.) Events that are disabled count towards the cost.
2.) Events associated with other PMUs [for example, software events or
breakpoints] do not count towards the cost, but do fail validation, causing the group to fail.
This patch changes validate_event so that it ignores events in the PERF_EVENT_STATE_OFF state or that are scheduled for other PMUs.
---
Resend with correct spelling of Pawel's email address on CC. Jamie - are you ok with this fix?
arch/arm/kernel/perf_event.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/kernel/perf_event.c +2 -2
@@ -319,8 +319,8 @@ validate_event(struct cpu_hw_events *cpuc, {struct hw_perf_event fake_event = event->hw; -if (event->pmu && event->pmu != &pmu) -return 0 ; +if (event->pmu != &pmu || event->state <=PERF_EVENT_STATE_OFF ) +return 1 ;return armpmu->get_event_idx (cpuc, &fake_event) >=0 ; }
Signature · 1 line
1.6.3.3
PATCH 1/1 ARM: perf: fix event validation
Quoted 11 lines · Will Deacon
The
validate_eventfunction in the ARM perf events backend has the following problems:1.) Events that are disabled count towards the cost.
2.) Events associated with other PMUs [for example, software events or
breakpoints] do not count towards the cost, but do fail validation, causing the group to fail.This patch changes
validate_eventso that it ignores events in thePERF_EVENT_STATE_OFFstate or that are scheduled for other PMUs.
Quoted 7 lines
Cc Jamie Iles <[email protected]>Reported-by Pawel Moll <[email protected]>Signed-off-by Will Deacon <[email protected]>---
Resend with correct spelling of Pawel's email address on CC. Jamie - are you ok with this fix?
Yes, looks good to me.
PATCH 1/1 ARM: perf: fix event validation
Hi Jamie,
Quoted 17 lines · Will Deacon
Quoted 16 lines
The
validate_eventfunction in the ARM perf events backend has the following problems:1.) Events that are disabled count towards the cost.
2.) Events associated with other PMUs [for example, software events or
breakpoints] do not count towards the cost, but do fail validation, causing the group to fail.This patch changes
validate_eventso that it ignores events in thePERF_EVENT_STATE_OFFstate or that are scheduled for other PMUs.Cc Jamie Iles <[email protected]>Reported-by Pawel Moll <[email protected]>Signed-off-by Will Deacon <[email protected]>---
Quoted 5 lines
Quoted 2 lines
Resend with correct spelling of Pawel's email address on CC. Jamie - are you ok with this fix?
Yes, looks good to me.
Acked-by Jamie Iles <[email protected]>
Thanks for this. Submitted as 6352/1.
Will