aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-12-06 08:07:15 -0500
committerIngo Molnar <mingo@elte.hu>2011-12-06 14:41:06 -0500
commitc1d6f42f1a42c721513e2f388c208e5348004f64 (patch)
treec30bac2feecd91ceb012eb5523568360f40ce9a3 /arch/x86/kernel/cpu/perf_event.h
parentffb871bc9156ee2e5cf442f61250c5bd6aad17e3 (diff)
perf, x86: Implement arch event mask as quirk
Implement the disabling of arch events as a quirk so that we can print a message along with it. This creates some visibility into the problem space and could allow us to work on adding more work-around like the AAJ80 one. Requested-by: Ingo Molnar <mingo@elte.hu> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-wcja2z48wklzu1b0nkz0a5y7@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.h')
-rw-r--r--arch/x86/kernel/cpu/perf_event.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index f49c5c21085c..8944062f46e2 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -261,6 +261,11 @@ union perf_capabilities {
261 u64 capabilities; 261 u64 capabilities;
262}; 262};
263 263
264struct x86_pmu_quirk {
265 struct x86_pmu_quirk *next;
266 void (*func)(void);
267};
268
264/* 269/*
265 * struct x86_pmu - generic x86 pmu 270 * struct x86_pmu - generic x86 pmu
266 */ 271 */
@@ -299,7 +304,7 @@ struct x86_pmu {
299 void (*put_event_constraints)(struct cpu_hw_events *cpuc, 304 void (*put_event_constraints)(struct cpu_hw_events *cpuc,
300 struct perf_event *event); 305 struct perf_event *event);
301 struct event_constraint *event_constraints; 306 struct event_constraint *event_constraints;
302 void (*quirks)(void); 307 struct x86_pmu_quirk *quirks;
303 int perfctr_second_write; 308 int perfctr_second_write;
304 309
305 int (*cpu_prepare)(int cpu); 310 int (*cpu_prepare)(int cpu);
@@ -340,6 +345,15 @@ struct x86_pmu {
340 struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr); 345 struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr);
341}; 346};
342 347
348#define x86_add_quirk(func_) \
349do { \
350 static struct x86_pmu_quirk __quirk __initdata = { \
351 .func = func_, \
352 }; \
353 __quirk.next = x86_pmu.quirks; \
354 x86_pmu.quirks = &__quirk; \
355} while (0)
356
343#define ERF_NO_HT_SHARING 1 357#define ERF_NO_HT_SHARING 1
344#define ERF_HAS_RSP_1 2 358#define ERF_HAS_RSP_1 2
345 359