WSL2-Linux-Kernel/arch/powerpc/oprofile
Maynard Johnson e5fc948b11 powerpc: Fix oprofile sampling of marked events on POWER7
Description
-----------
Change ppc64 oprofile kernel driver to use the SLOT bits (MMCRA[37:39]only on
older processors where those bits are defined.

Background
----------
The performance monitor unit of the 64-bit POWER processor family has the
ability to collect accurate instruction-level samples when profiling on marked
events (i.e., "PM_MRK_<event-name>").  In processors prior to POWER6, the MMCRA
register contained "slot information" that the oprofile kernel driver used to
adjust the value latched in the SIAR at the time of a PMU interrupt.  But as of
POWER6, these slot bits in MMCRA are no longer necessary for oprofile to use,
since the SIAR itself holds the accurate sampled instruction address.  With
POWER6, these MMCRA slot bits were zero'ed out by hardware so oprofile's use of
these slot bits was, in effect, a NOP.  But with POWER7, these bits are no
longer zero'ed out; however, they serve some other purpose rather than slot
information.  Thus, using these bits on POWER7 to adjust the SIAR value results
in samples being attributed to the wrong instructions.  The attached patch
changes the oprofile kernel driver to ignore these slot bits on all newer
processors starting with POWER6.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
Signed-off-by: Michael Wolf <mjw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-05-15 16:43:41 +10:00
..
cell powerpc/cell: Add missing #include for oprofile 2009-02-10 14:39:08 +11:00
Makefile [POWERPC] Made FSL Book-E PMC support more generic 2008-02-05 23:34:14 -06:00
backtrace.c [POWERPC] powerpc oprofile __user annotations 2006-09-26 15:25:33 +10:00
common.c powerpc/oprofile: IBM CELL: add SPU event profiling support 2009-01-08 15:51:55 +01:00
op_model_7450.c powerpc/oprofile: G4 oprofile has variable number of counters 2009-03-11 17:10:16 +11:00
op_model_cell.c powerpc/oprofile: fix whitespaces in op_model_cell.c 2009-01-08 15:52:19 +01:00
op_model_fsl_emb.c [POWERPC] Made FSL Book-E PMC support more generic 2008-02-05 23:34:14 -06:00
op_model_pa6t.c powerpc: Change u64/s64 to a long long integer type 2009-01-13 14:47:59 +11:00
op_model_power4.c powerpc: Fix oprofile sampling of marked events on POWER7 2009-05-15 16:43:41 +10:00
op_model_rs64.c [CELL] oprofile: add support to OProfile for profiling CELL BE SPUs 2007-07-20 21:42:24 +02:00