aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2012-03-12 07:44:35 -0400
committerIngo Molnar <mingo@elte.hu>2012-03-12 15:44:54 -0400
commitf9b4eeb809c6d031cc9561cc34dd691701cb2c2a (patch)
tree3c0c5710faa38d4ba446c0ccdd473010e1f1262b /arch/x86/kernel/cpu/perf_event.h
parent35239e23c66f1614c76739b62a299c3c92d6eb68 (diff)
perf/x86: Prettify pmu config literals
I got somewhat tired of having to decode hex numbers.. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Stephane Eranian <eranian@google.com> Cc: Robert Richter <robert.richter@amd.com> Link: http://lkml.kernel.org/n/tip-0vsy1sgywc4uar3mu1szm0rg@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.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index 82db83b5c3bc..66fda0c26402 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -268,6 +268,29 @@ struct x86_pmu_quirk {
268 void (*func)(void); 268 void (*func)(void);
269}; 269};
270 270
271union x86_pmu_config {
272 struct {
273 u64 event:8,
274 umask:8,
275 usr:1,
276 os:1,
277 edge:1,
278 pc:1,
279 interrupt:1,
280 __reserved1:1,
281 en:1,
282 inv:1,
283 cmask:8,
284 event2:4,
285 __reserved2:4,
286 go:1,
287 ho:1;
288 } bits;
289 u64 value;
290};
291
292#define X86_CONFIG(args...) ((union x86_pmu_config){.bits = {args}}).value
293
271/* 294/*
272 * struct x86_pmu - generic x86 pmu 295 * struct x86_pmu - generic x86 pmu
273 */ 296 */