Skip to contentSkip to conversation

perf, x86: Fix LBR read-out

tip:perf/pebs tip-bot for Peter Zijlstra 1 participant 1 message Mar 10, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  63fb3f9b2312e131be5a0a2dddb63f2fb123db9b
Gitweb:     http://git.kernel.org/tip/63fb3f9b2312e131be5a0a2dddb63f2fb123db9b
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Tue, 9 Mar 2010 11:51:02 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 10 Mar 2010 13:23:39 +0100

perf, x86: Fix LBR read-out

Don't decrement the TOS twice...

LKML-Reference: <new-submission>

---
 arch/x86/kernel/cpu/perf_event_intel_lbr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/perf_event_intel_lbr.c +2 -2
index f278136..df4c98e 100644
@@ -129,7 +129,7 @@ static void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc)
 	u64 tos = intel_pmu_lbr_tos();
 	int i;
 
-	for (i = 0; i < x86_pmu.lbr_nr; i++, tos--) {
+	for (i = 0; i < x86_pmu.lbr_nr; i++) {
 		unsigned long lbr_idx = (tos - i) & mask;
 		union {
 			struct {
@@ -162,7 +162,7 @@ static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc)
 	u64 tos = intel_pmu_lbr_tos();
 	int i;
 
-	for (i = 0; i < x86_pmu.lbr_nr; i++, tos--) {
+	for (i = 0; i < x86_pmu.lbr_nr; i++) {
 		unsigned long lbr_idx = (tos - i) & mask;
 		u64 from, to, flags = 0;