summaryrefslogtreecommitdiff
path: root/tools/bpf/runqslower/Makefile
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-03-02 16:40:10 -0800
committerAndrii Nakryiko <andrii@kernel.org>2021-03-02 20:14:02 -0800
commit303dcc25b5c782547eb13b9f29426de843dd6f34 (patch)
tree87041d3e1f9cbd64972f698beb9e79b1c9283de2 /tools/bpf/runqslower/Makefile
parent85e142cb42a1e7b33971bf035dae432d8670c46b (diff)
downloadlinux-starfive-303dcc25b5c782547eb13b9f29426de843dd6f34.tar.gz
linux-starfive-303dcc25b5c782547eb13b9f29426de843dd6f34.tar.bz2
linux-starfive-303dcc25b5c782547eb13b9f29426de843dd6f34.zip
tools/runqslower: Allow substituting custom vmlinux.h for the build
Just like was done for bpftool and selftests in ec23eb705620 ("tools/bpftool: Allow substituting custom vmlinux.h for the build") and ca4db6389d61 ("selftests/bpf: Allow substituting custom vmlinux.h for selftests build"), allow to provide pre-generated vmlinux.h for runqslower build. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20210303004010.653954-1-andrii@kernel.org
Diffstat (limited to 'tools/bpf/runqslower/Makefile')
-rw-r--r--tools/bpf/runqslower/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile
index c96ba90c6f01..3818ec511fd2 100644
--- a/tools/bpf/runqslower/Makefile
+++ b/tools/bpf/runqslower/Makefile
@@ -69,12 +69,16 @@ $(OUTPUT) $(BPFOBJ_OUTPUT) $(BPFTOOL_OUTPUT):
$(QUIET_MKDIR)mkdir -p $@
$(OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(OUTPUT) $(BPFTOOL)
+ifeq ($(VMLINUX_H),)
$(Q)if [ ! -e "$(VMLINUX_BTF_PATH)" ] ; then \
echo "Couldn't find kernel BTF; set VMLINUX_BTF to" \
"specify its location." >&2; \
exit 1;\
fi
$(QUIET_GEN)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@
+else
+ $(Q)cp "$(VMLINUX_H)" $@
+endif
$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(BPFOBJ_OUTPUT)
$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) $@