forked from luck/tmp_suning_uos_patched
powerpc/oprofile: Fix error in oprofile power7_marked_instr_event() function
The calculation for the left shift of the mask OPROFILE_PM_PMCSEL_MSK has an error. The calculation is should be to shift left by (max_cntrs - cntr) times the width of the pmsel field width. However, the #define OPROFILE_MAX_PMC_NUM was used instead of OPROFILE_PMSEL_FIELD_WIDTH. This patch fixes the calculation. Signed-off-by: Carl Love <cel@us.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
72640d8803
commit
46ed7a76ae
|
@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1)
|
|||
for (pmc = 0; pmc < 4; pmc++) {
|
||||
psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
|
||||
<< (OPROFILE_MAX_PMC_NUM - pmc)
|
||||
* OPROFILE_MAX_PMC_NUM);
|
||||
* OPROFILE_PMSEL_FIELD_WIDTH);
|
||||
psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
|
||||
* OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL;
|
||||
unit = mmcr1 & (OPROFILE_PM_UNIT_MSK
|
||||
|
|
Loading…
Reference in New Issue
Block a user