aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_event.h
diff options
context:
space:
mode:
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