All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf, x86: Add INTEL_FLAGS_UEVENT_CONSTRAINT
@ 2014-09-10  0:49 Andi Kleen
  2014-09-10  0:49 ` [PATCH 2/2] perf, x86: Use INTEL_FLAGS_UEVENT_CONSTRAINT for PRECDIST Andi Kleen
  0 siblings, 1 reply; 11+ messages in thread
From: Andi Kleen @ 2014-09-10  0:49 UTC (permalink / raw)
  To: peterz; +Cc: linux-kernel, mingo, eranian, tglx, 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 related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-10-03  4:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-10  0:49 [PATCH 1/2] perf, x86: Add INTEL_FLAGS_UEVENT_CONSTRAINT Andi Kleen
2014-09-10  0:49 ` [PATCH 2/2] perf, x86: Use INTEL_FLAGS_UEVENT_CONSTRAINT for PRECDIST Andi Kleen
2014-09-10  7:59   ` Peter Zijlstra
2014-09-10  7:59     ` Peter Zijlstra
2014-09-10  8:37       ` Stephane Eranian
2014-09-10  8:39         ` Peter Zijlstra
2014-09-10 14:02     ` Andi Kleen
2014-09-10 14:22       ` Peter Zijlstra
2014-09-23  9:58         ` Peter Zijlstra
2014-10-03  4:02           ` Ingo Molnar
2014-09-10 20:38       ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.