public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf wrong branches event on AMD
@ 2010-07-01 19:30 Vince Weaver
  2010-07-01 19:54 ` Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Vince Weaver @ 2010-07-01 19:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Peter Zijlstra, Paul Mackerras, Arnaldo Carvalho de Melo

Hello

while doing some performance counter validation tests on some assembly 
language programs I noticed that the "branches:u" count was very wrong on 
AMD machines.

It looks like the wrong event was selected.

This is why event selection needs to be in user-space... it could be fixed 
instantly there, but the way things are done now it will take months to 
years for this fix to filter down to those trying to use perf counters...

Signed-off-by: Vince Weaver <vweaver1@eecs.utk.edu>

diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
index 611df11..c2897b7 100644
--- a/arch/x86/kernel/cpu/perf_event_amd.c
+++ b/arch/x86/kernel/cpu/perf_event_amd.c
@@ -102,8 +102,8 @@ static const u64 amd_perfmon_event_map[] =
   [PERF_COUNT_HW_INSTRUCTIONS]		= 0x00c0,
   [PERF_COUNT_HW_CACHE_REFERENCES]	= 0x0080,
   [PERF_COUNT_HW_CACHE_MISSES]		= 0x0081,
-  [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]	= 0x00c4,
-  [PERF_COUNT_HW_BRANCH_MISSES]		= 0x00c5,
+  [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]	= 0x00c2,
+  [PERF_COUNT_HW_BRANCH_MISSES]		= 0x00c3,
 };
 
 static u64 amd_pmu_event_map(int hw_event)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-07-04  9:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 19:30 [PATCH] perf wrong branches event on AMD Vince Weaver
2010-07-01 19:54 ` Arnaldo Carvalho de Melo
2010-07-02 11:38 ` Peter Zijlstra
2010-07-02 13:56   ` Vince Weaver
2010-07-02 14:23     ` Peter Zijlstra
2010-07-02 19:52       ` Vince Weaver
2010-07-03 13:54         ` Ingo Molnar
2010-07-04  0:30           ` David Dillow
2010-07-04  9:11             ` Ingo Molnar
2010-07-03 13:58 ` [tip:perf/urgent] perf, x86: Fix incorrect branches event on AMD CPUs tip-bot for Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox