[tip: perf/core] perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags

From: tip-bot2 for Anshuman Khandual
Date: Fri Sep 09 2022 - 04:53:44 EST


The following commit has been merged into the perf/core branch of tip:

Commit-ID: f67dd218fafd9de9a13d095e775b621db76a058f
Gitweb: https://git.kernel.org/tip/f67dd218fafd9de9a13d095e775b621db76a058f
Author: Anshuman Khandual <anshuman.khandual@xxxxxxx>
AuthorDate: Wed, 07 Sep 2022 14:49:22 +05:30
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Wed, 07 Sep 2022 21:54:00 +02:00

perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags

This just ensures that PERF_EVENT_FLAG_ARCH does not overlap with generic
hardware event flags.

Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Reviewed-by: James Clark <james.clark@xxxxxxx>
Link: https://lkml.kernel.org/r/20220907091924.439193-3-anshuman.khandual@xxxxxxx
---
include/linux/perf_event.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 3e3c075..f88cb31 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -141,6 +141,8 @@ struct hw_perf_event_extra {
#define PERF_EVENT_FLAG_ARCH 0x000fffff
#define PERF_EVENT_FLAG_USER_READ_CNT 0x80000000

+static_assert((PERF_EVENT_FLAG_USER_READ_CNT & PERF_EVENT_FLAG_ARCH) == 0);
+
/**
* struct hw_perf_event - performance event hardware details:
*/