summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/bpf-script-test-prologue.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/bpf-script-test-prologue.c')
-rw-r--r--tools/perf/tests/bpf-script-test-prologue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/tests/bpf-script-test-prologue.c b/tools/perf/tests/bpf-script-test-prologue.c
index 7230e62c70fc..b4ebc75e25ae 100644
--- a/tools/perf/tests/bpf-script-test-prologue.c
+++ b/tools/perf/tests/bpf-script-test-prologue.c
@@ -10,6 +10,15 @@
#include <uapi/linux/fs.h>
+/*
+ * If CONFIG_PROFILE_ALL_BRANCHES is selected,
+ * 'if' is redefined after include kernel header.
+ * Recover 'if' for BPF object code.
+ */
+#ifdef if
+# undef if
+#endif
+
#define FMODE_READ 0x1
#define FMODE_WRITE 0x2