Skip to content

Commit 4749f81

Browse files
kliang2Ingo Molnar
authored andcommitted
perf/x86/intel/uncore: Correct fixed counter index check in generic code
There is no index which is bigger than UNCORE_PMC_IDX_FIXED. The only exception is client IMC uncore, which has been specially handled. For generic code, it is not correct to use >= to check fixed counter. The code quality issue will bring problem when a new counter index is introduced. Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent d71f11c commit 4749f81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/events/intel/uncore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *e
218218
u64 prev_count, new_count, delta;
219219
int shift;
220220

221-
if (event->hw.idx >= UNCORE_PMC_IDX_FIXED)
221+
if (event->hw.idx == UNCORE_PMC_IDX_FIXED)
222222
shift = 64 - uncore_fixed_ctr_bits(box);
223223
else
224224
shift = 64 - uncore_perf_ctr_bits(box);

0 commit comments

Comments
 (0)