linux/arch/powerpc
Paul Mackerras a6dbf93a2a powerpc: Fix bug where perf_counters breaks oprofile
Currently there is a bug where if you use oprofile on a pSeries
machine, then use perf_counters, then use oprofile again, oprofile
will not work correctly; it will lose the PMU configuration the next
time the hypervisor does a partition context switch, and thereafter
won't count anything.

Maynard Johnson identified the sequence causing the problem:
- oprofile setup calls ppc_enable_pmcs(), which calls
  pseries_lpar_enable_pmcs, which tells the hypervisor that we want
  to use the PMU, and sets the "PMU in use" flag in the lppaca.
  This flag tells the hypervisor whether it needs to save and restore
  the PMU config.
- The perf_counter code sets and clears the "PMU in use" flag directly
  as it context-switches the PMU between tasks, and leaves it clear
  when it finishes.
- oprofile setup, called for a new oprofile run, calls ppc_enable_pmcs,
  which does nothing because it has already been called.  In particular
  it doesn't set the "PMU in use" flag.

This fixes the problem by arranging for ppc_enable_pmcs to always set
the "PMU in use" flag.  It makes the perf_counter code call
ppc_enable_pmcs also rather than calling the lower-level function
directly, and removes the setting of the "PMU in use" flag from
pseries_lpar_enable_pmcs, since that is now done in its caller.

This also removes the declaration of pasemi_enable_pmcs because it
isn't defined anywhere.

Reported-by: Maynard Johnson <mpjohn@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: <stable@kernel.org)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-09-11 11:27:58 +10:00
..
boot powerpc/405ex: support cuImage via included dtb 2009-08-31 09:23:22 -04:00
configs powerpc/44x: Add Eiger AMCC (AppliedMicro) PPC460SX evaluation board support. 2009-08-31 08:24:15 -04:00
include/asm powerpc: Fix bug where perf_counters breaks oprofile 2009-09-11 11:27:58 +10:00
kernel powerpc: Fix bug where perf_counters breaks oprofile 2009-09-11 11:27:58 +10:00
kvm powerpc: Use names rather than numbers for SPRGs (v2) 2009-08-20 10:12:27 +10:00
lib powerpc: Add configurable -Werror for arch/powerpc 2009-06-16 14:15:45 +10:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm powerpc/pseries: Fix to handle slb resize across migration 2009-09-02 16:19:01 +10:00
oprofile powerpc: Remove unnecessary semicolons 2009-07-08 13:50:21 +10:00
platforms powerpc: Fix bug where perf_counters breaks oprofile 2009-09-11 11:27:58 +10:00
sysdev powerpc/qe_lib: Set gpio data before changing the direction to output 2009-08-25 21:08:45 -05:00
xmon powerpc: Enable GCOV 2009-08-20 10:29:28 +10:00
Kconfig powerpc: Add CONFIG_DMA_API_DEBUG support 2009-08-28 14:24:11 +10:00
Kconfig.debug powerpc: Add configurable -Werror for arch/powerpc 2009-06-16 14:15:45 +10:00
Makefile powerpc: Makefile simplification through use of cc-ifversion 2009-08-20 10:12:33 +10:00