sparc: perf: Remove redundant perf_pmu_{en|dis}able calls
Subsystems (2)
PATCH 1/1 sparc: perf: Remove redundant perf_pmu_{en|dis}able calls
perf_pmu_disable is called by core perf code before pmu->del and the enable function is called by core perf code afterwards. No need to call again within sparc_pmu_del.
Ditto for pmu->add and sparc_pmu_add.
--- arch/sparc/kernel/perf_event.c | 4 ---- 1 file changed, 4 deletions(-)
arch/sparc/kernel/perf_event.c +0 -4
@@ -1101,7 +1101,6 @@ static void sparc_pmu_del(struct perf_event *event, int _flags)int i;local_irq_save (flags); -perf_pmu_disable (event->pmu);for (i =0 ; i < cpuc->n_events; i++) {if (event = cpuc->event[i]) {
@@ -1127,7 +1126,6 @@ static void sparc_pmu_del(struct perf_event *event, int _flags) } } -perf_pmu_enable (event->pmu);local_irq_restore (flags); }
@@ -1361,7 +1359,6 @@ static int sparc_pmu_add(struct perf_event *event, int ef_flags)unsigned long flags;local_irq_save (flags); -perf_pmu_disable (event->pmu); n0 = cpuc->n_events;if (n0 >= sparc_pmu->max_hw_events)
@@ -1394,7 +1391,6 @@ static int sparc_pmu_add(struct perf_event *event, int ef_flags) ret =0 ; out: -perf_pmu_enable (event->pmu);local_irq_restore (flags);return ret; }
Signature · 1 line
2.3.0
From: David Ahern <[email protected]>
Date: Thu, 19 Mar 2015 16:05:57 -0400
Quoted 8 lines
perf_pmu_disableis called by core perf code beforepmu->deland the enable function is called by core perf code afterwards. No need to call again withinsparc_pmu_del.Ditto for
pmu->addandsparc_pmu_add.Signed-off-by David Ahern <[email protected]>Acked-by Bob Picco <[email protected]>
Applied, thanks David.
I wonder why I coded it this way, maybe long ago in the past the caller didn't do this.
Quoted 2 lines · David Miller
I wonder why I coded it this way, maybe long ago in the past the caller didn't do this.
short answer: I know 2.6.39 does not need this, so it changed somewhere between 2.6.39 and 3.18.
From what I can tell you used the x86 perf code as the template for
sparc. That was roughly 2009 or 2010. The x86 code has changed a lot over the years; the sparc code not so much.