aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2015-01-14 08:15:39 -0500
committerIngo Molnar <mingo@kernel.org>2015-02-18 11:24:57 -0500
commitacba3c7e4652ca5fcb2fd9376d58c2dffd8ddf2a (patch)
treec3fa452cb13383d4e41bdf6d9c7f6e24e1f7d65f /arch/powerpc/perf
parent384b60557b5522fcb99646f0eb6e7a344cdb94c6 (diff)
perf, powerpc: Fix up flush_branch_stack() users
The recent LBR rework for x86 left a stray flush_branch_stack() user in the PowerPC code, fix that up. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com> Cc: Anton Blanchard <anton@samba.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Christoph Lameter <cl@linux.com> Cc: Joel Stanley <joel@jms.id.au> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Neuling <mikey@neuling.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Tejun Heo <tj@kernel.org> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r--arch/powerpc/perf/core-book3s.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 7c4f6690533a..7fd60dcb2cb0 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -124,7 +124,7 @@ static unsigned long ebb_switch_in(bool ebb, struct cpu_hw_events *cpuhw)
124 124
125static inline void power_pmu_bhrb_enable(struct perf_event *event) {} 125static inline void power_pmu_bhrb_enable(struct perf_event *event) {}
126static inline void power_pmu_bhrb_disable(struct perf_event *event) {} 126static inline void power_pmu_bhrb_disable(struct perf_event *event) {}
127static void power_pmu_flush_branch_stack(void) {} 127static void power_pmu_sched_task(struct perf_event_context *ctx, bool sched_in) {}
128static inline void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw) {} 128static inline void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw) {}
129static void pmao_restore_workaround(bool ebb) { } 129static void pmao_restore_workaround(bool ebb) { }
130#endif /* CONFIG_PPC32 */ 130#endif /* CONFIG_PPC32 */
@@ -350,6 +350,7 @@ static void power_pmu_bhrb_enable(struct perf_event *event)
350 cpuhw->bhrb_context = event->ctx; 350 cpuhw->bhrb_context = event->ctx;
351 } 351 }
352 cpuhw->bhrb_users++; 352 cpuhw->bhrb_users++;
353 perf_sched_cb_inc(event->ctx->pmu);
353} 354}
354 355
355static void power_pmu_bhrb_disable(struct perf_event *event) 356static void power_pmu_bhrb_disable(struct perf_event *event)
@@ -361,6 +362,7 @@ static void power_pmu_bhrb_disable(struct perf_event *event)
361 362
362 cpuhw->bhrb_users--; 363 cpuhw->bhrb_users--;
363 WARN_ON_ONCE(cpuhw->bhrb_users < 0); 364 WARN_ON_ONCE(cpuhw->bhrb_users < 0);
365 perf_sched_cb_dec(event->ctx->pmu);
364 366
365 if (!cpuhw->disabled && !cpuhw->bhrb_users) { 367 if (!cpuhw->disabled && !cpuhw->bhrb_users) {
366 /* BHRB cannot be turned off when other 368 /* BHRB cannot be turned off when other
@@ -375,9 +377,12 @@ static void power_pmu_bhrb_disable(struct perf_event *event)
375/* Called from ctxsw to prevent one process's branch entries to 377/* Called from ctxsw to prevent one process's branch entries to
376 * mingle with the other process's entries during context switch. 378 * mingle with the other process's entries during context switch.
377 */ 379 */
378static void power_pmu_flush_branch_stack(void) 380static void power_pmu_sched_task(struct perf_event_context *ctx, bool sched_in)
379{ 381{
380 if (ppmu->bhrb_nr) 382 if (!ppmu->bhrb_nr)
383 return;
384
385 if (sched_in)
381 power_pmu_bhrb_reset(); 386 power_pmu_bhrb_reset();
382} 387}
383/* Calculate the to address for a branch */ 388/* Calculate the to address for a branch */
@@ -1901,7 +1906,7 @@ static struct pmu power_pmu = {
1901 .cancel_txn = power_pmu_cancel_txn, 1906 .cancel_txn = power_pmu_cancel_txn,
1902 .commit_txn = power_pmu_commit_txn, 1907 .commit_txn = power_pmu_commit_txn,
1903 .event_idx = power_pmu_event_idx, 1908 .event_idx = power_pmu_event_idx,
1904 .flush_branch_stack = power_pmu_flush_branch_stack, 1909 .sched_task = power_pmu_sched_task,
1905}; 1910};
1906 1911
1907/* 1912/*