lkml.org 
[lkml]   [2010]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/4] x86,perf: P4 PMU -- configurate predefined events
If an event is not RAW we should exit p4_hw_config
early but call x86_setup_perfctr as well.

CC: Peter Zijlstra <peterz@infradead.org>
CC: Ingo Molnar <mingo@elte.hu>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Lin Ming <ming.m.lin@intel.com>
CC: Robert Richter <robert.richter@amd.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---

Robert, if only I'm not missing something this is
a side effect of commit 9d0fcba67e47ff398a6fa86476d4884d472dc98a,
wonders why don't we hit it earlier. Am I wrong?

arch/x86/kernel/cpu/perf_event_p4.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)

Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event_p4.c
+++ linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
@@ -439,21 +439,20 @@ static int p4_hw_config(struct perf_even
if (p4_ht_active() && p4_ht_thread(cpu))
event->hw.config = p4_set_ht_bit(event->hw.config);

- if (event->attr.type != PERF_TYPE_RAW)
- return 0;
-
- /*
- * We don't control raw events so it's up to the caller
- * to pass sane values (and we don't count the thread number
- * on HT machine but allow HT-compatible specifics to be
- * passed on)
- *
- * XXX: HT wide things should check perf_paranoid_cpu() &&
- * CAP_SYS_ADMIN
- */
- event->hw.config |= event->attr.config &
- (p4_config_pack_escr(P4_ESCR_MASK_HT) |
- p4_config_pack_cccr(P4_CCCR_MASK_HT));
+ if (event->attr.type == PERF_TYPE_RAW) {
+ /*
+ * We don't control raw events so it's up to the caller
+ * to pass sane values (and we don't count the thread number
+ * on HT machine but allow HT-compatible specifics to be
+ * passed on)
+ *
+ * XXX: HT wide things should check perf_paranoid_cpu() &&
+ * CAP_SYS_ADMIN
+ */
+ event->hw.config |= event->attr.config &
+ (p4_config_pack_escr(P4_ESCR_MASK_HT) |
+ p4_config_pack_cccr(P4_CCCR_MASK_HT));
+ }

return x86_setup_perfctr(event);
}


\
 
 \ /
  Last update: 2010-05-08 13:31    [W:0.533 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site