Skip to content

Commit 44fe619

Browse files
committed
perf tools: Fix the build on the alpine:edge distro
The UAPI file byteorder/little_endian.h uses the __always_inline define without including the header where it is defined, linux/stddef.h, this ends up working in all the other distros because that file gets included seemingly by luck from one of the files included from little_endian.h. But not on Alpine:edge, that fails for all files where perf_event.h is included but linux/stddef.h isn't include before that. Adding the missing linux/stddef.h file where it breaks on Alpine:edge to fix that, in all other distros, that is just a very small header anyway. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Wang Nan <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 1f27a05 commit 44fe619

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

tools/perf/arch/x86/util/pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <string.h>
33

4+
#include <linux/stddef.h>
45
#include <linux/perf_event.h>
56

67
#include "../../util/intel-pt.h"

tools/perf/arch/x86/util/tsc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <stdbool.h>
33
#include <errno.h>
44

5+
#include <linux/stddef.h>
56
#include <linux/perf_event.h>
67

78
#include "../../perf.h"

tools/perf/perf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <time.h>
66
#include <stdbool.h>
77
#include <linux/types.h>
8+
#include <linux/stddef.h>
89
#include <linux/perf_event.h>
910

1011
extern bool test_attr__enabled;

tools/perf/util/header.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#ifndef __PERF_HEADER_H
33
#define __PERF_HEADER_H
44

5+
#include <linux/stddef.h>
56
#include <linux/perf_event.h>
67
#include <sys/types.h>
78
#include <stdbool.h>

tools/perf/util/namespaces.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define __PERF_NAMESPACES_H
1111

1212
#include <sys/types.h>
13+
#include <linux/stddef.h>
1314
#include <linux/perf_event.h>
1415
#include <linux/refcount.h>
1516
#include <linux/types.h>

0 commit comments

Comments
 (0)