Skip to contentSkip to conversation

tools/runqslower: ensure own vmlinux.h is picked up first

PATCH Applied Andrii Nakryiko 2 participants 2 messages Apr 22, 2020 – Apr 25, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/runqslower: ensure own vmlinux.h is picked up first

Reorder include paths to ensure that runqslower sources are picking up vmlinux.h, generated by runqslower's own Makefile. When runqslower is built from selftests/bpf, due to current -I$(BPF_INCLUDE) -I$(OUTPUT) ordering, it might pick up not-yet-complete vmlinux.h, generated by selftests Makefile, which could lead to compilation errors like [0]. So ensure that -I$(OUTPUT) goes first and rely on runqslower's Makefile own dependency chain to ensure vmlinux.h is properly completed before source code relying on it is compiled.

[0] https://travis-ci.org/github/libbpf/libbpf/jobs/677905925

---
 tools/bpf/runqslower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/runqslower/Makefile +1 -1
index 39edd68afa8e..8a6f82e56a24 100644
@@ -8,7 +8,7 @@ BPFTOOL ?= $(DEFAULT_BPFTOOL)
 LIBBPF_SRC := $(abspath ../../lib/bpf)
 BPFOBJ := $(OUTPUT)/libbpf.a
 BPF_INCLUDE := $(OUTPUT)
-INCLUDES := -I$(BPF_INCLUDE) -I$(OUTPUT) -I$(abspath ../../lib)
+INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../lib)
 CFLAGS := -g -Wall
 
 # Try to detect best kernel BTF source
Signature · 1 line
2.24.1
#1 lore raw
Quoted 9 lines · Andrii Nakryiko

Reorder include paths to ensure that runqslower sources are picking up vmlinux.h, generated by runqslower's own Makefile. When runqslower is built from selftests/bpf, due to current -I$(BPF_INCLUDE) -I$(OUTPUT) ordering, it might pick up not-yet-complete vmlinux.h, generated by selftests Makefile, which could lead to compilation errors like [0]. So ensure that -I$(OUTPUT) goes first and rely on runqslower's Makefile own dependency chain to ensure vmlinux.h is properly completed before source code relying on it is compiled.

Quoted 3 lines

[0] https://travis-ci.org/github/libbpf/libbpf/jobs/677905925

Applied to bpf tree. Thanks