diff options
author | Anshuman Khandual <anshuman.khandual@arm.com> | 2022-09-07 14:49:23 +0530 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-09-07 21:54:01 +0200 |
commit | 91207f62616f9f51b52436364e6d064f002e9112 (patch) | |
tree | e0645862b754f38f1fd61b84d8b9b446c56f5a9a /include/linux/perf | |
parent | f67dd218fafd9de9a13d095e775b621db76a058f (diff) | |
download | lwn-91207f62616f9f51b52436364e6d064f002e9112.tar.gz lwn-91207f62616f9f51b52436364e6d064f002e9112.zip |
arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH
Ensure all platform specific event flags are within PERF_EVENT_FLAG_ARCH.
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-4-anshuman.khandual@arm.com
Diffstat (limited to 'include/linux/perf')
-rw-r--r-- | include/linux/perf/arm_pmu.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index 0407a38b470a..0356cb6a215d 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h @@ -24,10 +24,11 @@ /* * ARM PMU hw_event flags */ -/* Event uses a 64bit counter */ -#define ARMPMU_EVT_64BIT 1 -/* Event uses a 47bit counter */ -#define ARMPMU_EVT_47BIT 2 +#define ARMPMU_EVT_64BIT 0x00001 /* Event uses a 64bit counter */ +#define ARMPMU_EVT_47BIT 0x00002 /* Event uses a 47bit counter */ + +static_assert((PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_64BIT) == ARMPMU_EVT_64BIT); +static_assert((PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_47BIT) == ARMPMU_EVT_47BIT); #define HW_OP_UNSUPPORTED 0xFFFF #define C(_x) PERF_COUNT_HW_CACHE_##_x |