perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags
authorAnshuman Khandual <anshuman.khandual@arm.com>
Wed, 7 Sep 2022 09:19:22 +0000 (14:49 +0530)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 7 Sep 2022 19:54:00 +0000 (21:54 +0200)
This just ensures that PERF_EVENT_FLAG_ARCH does not overlap with generic
hardware event flags.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: James Clark <james.clark@arm.com>
Link: https://lkml.kernel.org/r/20220907091924.439193-3-anshuman.khandual@arm.com
include/linux/perf_event.h

index 3e3c07512b75f56f835592b6ee4c9253bfdefb35..f88cb31eaf756083e6d22a318af8be76823ac6cb 100644 (file)
@@ -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:
  */