Skip to contentSkip to conversation

perf bpf: Give precedence to bpf header dir

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Sep 6, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  d35b168c3dcdf103c2b2d694ad8513a669781703
Gitweb:     https://git.kernel.org/tip/d35b168c3dcdf103c2b2d694ad8513a669781703
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 29 Aug 2018 23:53:22 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 30 Aug 2018 15:52:20 -0300

perf bpf: Give precedence to bpf header dir

I need to check the need for $KERNEL_INC_OPTIONS when building eBPF restricted C programs, for now just give precedence to $PERF_BPF_INC_OPTIONS so that we can get a linux/socket.h usable in eBPF programs.

---
 tools/perf/util/llvm-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/llvm-utils.c +1 -1
index 19262f98cd4e..5b0b60f00275 100644
@@ -19,7 +19,7 @@
 #define CLANG_BPF_CMD_DEFAULT_TEMPLATE				\
 		"$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\
 		"-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE "	\
-		"$CLANG_OPTIONS $KERNEL_INC_OPTIONS $PERF_BPF_INC_OPTIONS " \
+		"$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \
 		"-Wno-unused-value -Wno-pointer-sign "		\
 		"-working-directory $WORKING_DIR "		\
 		"-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE"