mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] perf, x86: Add INTEL_FLAGS_UEVENT_CONSTRAINT
@ 2014-09-24 14:34 Andi Kleen
  2014-09-24 14:34 ` [PATCH 2/3] perf, x86: Use INTEL_FLAGS_UEVENT_CONSTRAINT for PRECDIST Andi Kleen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andi Kleen @ 2014-09-24 14:34 UTC (permalink / raw)
  To: peterz; +Cc: linux-kernel, mingo, eranian, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

Add a FLAGS_UEVENT_CONSTRAINT macro that allows us to
match on event+umask, and in additional all flags.

This is needed to ensure the INV and CMASK fields
are zero for specific events, as this can cause undefined
behavior.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/perf_event.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index fc5eb39..4e6cdb0 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -253,6 +253,10 @@ struct cpu_hw_events {
 #define INTEL_UEVENT_CONSTRAINT(c, n)	\
 	EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK)
 
+/* Like UEVENT_CONSTRAINT, but match flags too */
+#define INTEL_FLAGS_UEVENT_CONSTRAINT(c, n)	\
+	EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK|X86_ALL_EVENT_FLAGS)
+
 #define INTEL_PLD_CONSTRAINT(c, n)	\
 	__EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK|X86_ALL_EVENT_FLAGS, \
 			   HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_LDLAT)
-- 
1.9.3


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

end of thread, other threads:[~2014-11-16 12:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 14:34 [PATCH 1/3] perf, x86: Add INTEL_FLAGS_UEVENT_CONSTRAINT Andi Kleen
2014-09-24 14:34 ` [PATCH 2/3] perf, x86: Use INTEL_FLAGS_UEVENT_CONSTRAINT for PRECDIST Andi Kleen
2014-11-16 12:35   ` [tip:perf/core] perf/x86/intel: " tip-bot for Andi Kleen
2014-09-24 14:34 ` [PATCH 3/3] perf, x86: Disallow flags for most Core2/Atom/Nehalem/Westmere events Andi Kleen
2014-11-16 12:35   ` [tip:perf/core] perf/x86/intel: Disallow flags for most Core2/ Atom/Nehalem/Westmere events tip-bot for Andi Kleen
2014-09-25  9:25 ` [PATCH 1/3] perf, x86: Add INTEL_FLAGS_UEVENT_CONSTRAINT Peter Zijlstra
2014-11-16 12:34 ` [tip:perf/core] perf/x86: " tip-bot for Andi Kleen

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

Powered by JetHome