Skip to content

Commit 7550ddf

Browse files
Andi KleenIngo Molnar
authored andcommitted
perf/x86: Add INTEL_FLAGS_UEVENT_CONSTRAINT
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Kan Liang <[email protected]> Cc: Maria Dimakopoulou <[email protected]> Cc: Mark Davies <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent c0737ce commit 7550ddf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kernel/cpu/perf_event.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ struct cpu_hw_events {
253253
#define INTEL_UEVENT_CONSTRAINT(c, n) \
254254
EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK)
255255

256+
/* Like UEVENT_CONSTRAINT, but match flags too */
257+
#define INTEL_FLAGS_UEVENT_CONSTRAINT(c, n) \
258+
EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK|X86_ALL_EVENT_FLAGS)
259+
256260
#define INTEL_PLD_CONSTRAINT(c, n) \
257261
__EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK|X86_ALL_EVENT_FLAGS, \
258262
HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_LDLAT)

0 commit comments

Comments
 (0)