Skip to contentSkip to conversation

perf_counter, x86: Fix generic cache events on P6-mobile CPUs

tip:perfcounters/urgent tip-bot for Ingo Molnar 1 participant 1 message Aug 11, 2009 x86

lore
Share & tools
lore
#0 lore raw
Commit-ID:  f64ccccb8afa43abdd63fcbd230f818d6ea0883f
Gitweb:     http://git.kernel.org/tip/f64ccccb8afa43abdd63fcbd230f818d6ea0883f
Author:     Ingo Molnar <[email protected]>
AuthorDate: Tue, 11 Aug 2009 10:26:33 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 11 Aug 2009 11:35:26 +0200

perf_counter, x86: Fix generic cache events on P6-mobile CPUs

Johannes Stezenbach reported that 'perf stat' does not count cache-miss and cache-references events on his Pentium-M based laptop.

This is because we left them blank in p6_perfmon_event_map[], fill them in.

Cc Peter Zijlstra <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>

LKML-Reference: <new-submission>

---
 arch/x86/kernel/cpu/perf_counter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/perf_counter.c +2 -2
index 40e233a..fffc126 100644
@@ -72,8 +72,8 @@ static const u64 p6_perfmon_event_map[] =
 {
   [PERF_COUNT_HW_CPU_CYCLES]		= 0x0079,
   [PERF_COUNT_HW_INSTRUCTIONS]		= 0x00c0,
-  [PERF_COUNT_HW_CACHE_REFERENCES]	= 0x0000,
-  [PERF_COUNT_HW_CACHE_MISSES]		= 0x0000,
+  [PERF_COUNT_HW_CACHE_REFERENCES]	= 0x0f2e,
+  [PERF_COUNT_HW_CACHE_MISSES]		= 0x012e,
   [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]	= 0x00c4,
   [PERF_COUNT_HW_BRANCH_MISSES]		= 0x00c5,
   [PERF_COUNT_HW_BUS_CYCLES]		= 0x0062,