diff options
author | Carl E. Love <cel@linux.vnet.ibm.com> | 2012-11-29 01:42:03 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-01-28 18:18:14 -0500 |
commit | 46ed7a76ae7770cb8ba733ee2b06273397ad8b5b (patch) | |
tree | f0b0f73d2bb546d82f15d8ae98115932f70fc8f9 /arch | |
parent | 72640d880350165c3a7b8f2e4fb4bf852ea7b606 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/oprofile/op_model_power4.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c index 315f9495e9b2..f444b94935f5 100644 --- a/arch/powerpc/oprofile/op_model_power4.c +++ b/arch/powerpc/oprofile/op_model_power4.c | |||
@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1) | |||
52 | for (pmc = 0; pmc < 4; pmc++) { | 52 | for (pmc = 0; pmc < 4; pmc++) { |
53 | psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK | 53 | psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK |
54 | << (OPROFILE_MAX_PMC_NUM - pmc) | 54 | << (OPROFILE_MAX_PMC_NUM - pmc) |
55 | * OPROFILE_MAX_PMC_NUM); | 55 | * OPROFILE_PMSEL_FIELD_WIDTH); |
56 | psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc) | 56 | psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc) |
57 | * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL; | 57 | * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL; |
58 | unit = mmcr1 & (OPROFILE_PM_UNIT_MSK | 58 | unit = mmcr1 & (OPROFILE_PM_UNIT_MSK |