Commit 46ed7a76 authored by Carl E. Love's avatar Carl E. Love Committed by Benjamin Herrenschmidt

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
Signed-off-by: default avatarCarl Love <>
Acked-by: default avatarPaul Mackerras <>
Signed-off-by: default avatarBenjamin Herrenschmidt <>
parent 72640d88
......@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1)
for (pmc = 0; pmc < 4; pmc++) {
psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
unit = mmcr1 & (OPROFILE_PM_UNIT_MSK
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment