From: Anshuman Khandual Date: Wed, 7 Sep 2022 09:19:22 +0000 (+0530) Subject: perf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f67dd218fafd9de9a13d095e775b621db76a058f;p=linux.git 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: James Clark Link: https://lkml.kernel.org/r/20220907091924.439193-3-anshuman.khandual@arm.com --- diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 3e3c07512b75f..f88cb31eaf756 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: */