Skip to content

Commit d5e5737

Browse files
committed
libperf: Do not include non-UAPI linux/compiler.h header
Its just for that __packed define, so use it expanded as __attribute__((packed)), like the other files in /usr/include do. This was problem was preventing building the libperf examples on ALT Linux and Fedora 35, fix it. Reported-by: Vitaly Chikunov <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Dmitry Levin <[email protected] Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent fe180a5 commit d5e5737

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/lib/perf/include/perf/event.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <linux/types.h>
77
#include <linux/limits.h>
88
#include <linux/bpf.h>
9-
#include <linux/compiler.h>
109
#include <sys/types.h> /* pid_t */
1110

1211
#define event_contains(obj, mem) ((obj).header.size > offsetof(typeof(obj), mem))
@@ -207,7 +206,7 @@ struct perf_record_range_cpu_map {
207206
__u16 end_cpu;
208207
};
209208

210-
struct __packed perf_record_cpu_map_data {
209+
struct perf_record_cpu_map_data {
211210
__u16 type;
212211
union {
213212
/* Used when type == PERF_CPU_MAP__CPUS. */
@@ -219,7 +218,7 @@ struct __packed perf_record_cpu_map_data {
219218
/* Used when type == PERF_CPU_MAP__RANGE_CPUS. */
220219
struct perf_record_range_cpu_map range_cpu_data;
221220
};
222-
};
221+
} __attribute__((packed));
223222

224223
#pragma GCC diagnostic pop
225224

0 commit comments

Comments
 (0)