Power 7+, OProfile: reject samples if marked event and the SIAR valid bit is not set.
PATCH 1/1 Power 7+, OProfile: reject samples if marked event and the SIAR valid bit is not set.
Ben:
Please review the following patch. If it is acceptable, will you please commit it. We would like to get this into mainline so we can move forward with getting the fix pushed into the next RHAT and SLES releases. Note that a similar fix for rejecting the invaild SIAR and SDAR values is being worked on by Sukadev BHattiprolu for perf. His patch will have to reject invalid SIAR and SDAR values.
Carl Love
--------------------------------------------------------------------------------------------------
[PATCH] Power 7+, OProfile: reject samples if marked event and the SIAR valid bit is not set.
Starting with Power 7+ we need to check for marked events if the SIAR register is valid, i.e. it contains the correct address of the instruction at the time the performance counter overflowed. The mmcra register on Power 7+, contains a new bit to indicate that the contents of the SIAR is valid. If the event is not marked, then the sample is recorded independently of the SIAR valid bit setting. For older processors, there is no SIAR valid bit to check so the samples are always recorded. This is done by forcing the cntr_marked_events bit mask to zero. The code will always record the sample in this case since the bit mask says the event is not a marked event even if it really is a marked event.
The patch is dependent on the PV_POWER7P CPU #define in arch/powerpc/include/asm/reg.h. This #define has not been added yet to the mainline kernel. This patch adds the needed #define based on the value from the BML p7p_cputable patch. The mainline kernel has most of the additions from the BML patch with the notable exception of the #define for PV_POWER7P.
--- arch/powerpc/include/asm/reg.h | 1 + arch/powerpc/oprofile/op_model_power4.c | 100 ++++++++++++++++++++++++++++++- 2 files changed, 100 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/reg.h +1 -0
@@ -1014,6 +1014,7 @@#define PV_970FX 0x003C#define PV_POWER6 0x003E#define PV_POWER7 0x003F +#define PV_POWER7P 0x004A#define PV_630 0x0040#define PV_630p 0x0041#define PV_970MP 0x0044
arch/powerpc/oprofile/op_model_power4.c +99 -1
134 lines not on this page · raw message
Signature · 1 line
1.7.0.4