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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
  */



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux