Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'Use lightweigt version of bpftool'

Pu Lehui says:

====================

Currently, samples/bpf, tools/runqslower and bpf/iterators use bpftool
for vmlinux.h, skeleton, and static linking only. We can use lightweight
bootstrap version of bpftool to handle these, and it will be faster.

v2:
- make libbpf and bootstrap bpftool independent. and make it simple.

v1: https://lore.kernel.org/bpf/20220712030813.865410-1-pulehui@huawei.com
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

+10 -17
+3 -7
kernel/bpf/preload/iterators/Makefile
··· 9 9 TOOLS_PATH := $(abspath ../../../../tools) 10 10 BPFTOOL_SRC := $(TOOLS_PATH)/bpf/bpftool 11 11 BPFTOOL_OUTPUT := $(abs_out)/bpftool 12 - DEFAULT_BPFTOOL := $(OUTPUT)/sbin/bpftool 12 + DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool 13 13 BPFTOOL ?= $(DEFAULT_BPFTOOL) 14 14 15 15 LIBBPF_SRC := $(TOOLS_PATH)/lib/bpf ··· 61 61 OUTPUT=$(abspath $(dir $@))/ prefix= \ 62 62 DESTDIR=$(LIBBPF_DESTDIR) $(abspath $@) install_headers 63 63 64 - $(DEFAULT_BPFTOOL): $(BPFOBJ) | $(BPFTOOL_OUTPUT) 65 - $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOL_SRC) \ 66 - OUTPUT=$(BPFTOOL_OUTPUT)/ \ 67 - LIBBPF_OUTPUT=$(LIBBPF_OUTPUT)/ \ 68 - LIBBPF_DESTDIR=$(LIBBPF_DESTDIR)/ \ 69 - prefix= DESTDIR=$(abs_out)/ install-bin 64 + $(DEFAULT_BPFTOOL): | $(BPFTOOL_OUTPUT) 65 + $(Q)$(MAKE) $(submake_extras) -C $(BPFTOOL_SRC) OUTPUT=$(BPFTOOL_OUTPUT)/ bootstrap
+4 -6
samples/bpf/Makefile
··· 282 282 283 283 BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool 284 284 BPFTOOL_OUTPUT := $(abspath $(BPF_SAMPLES_PATH))/bpftool 285 - BPFTOOL := $(BPFTOOL_OUTPUT)/bpftool 286 - $(BPFTOOL): $(LIBBPF) $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) | $(BPFTOOL_OUTPUT) 287 - $(MAKE) -C $(BPFTOOLDIR) srctree=$(BPF_SAMPLES_PATH)/../../ \ 288 - OUTPUT=$(BPFTOOL_OUTPUT)/ \ 289 - LIBBPF_OUTPUT=$(LIBBPF_OUTPUT)/ \ 290 - LIBBPF_DESTDIR=$(LIBBPF_DESTDIR)/ 285 + BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool 286 + $(BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) | $(BPFTOOL_OUTPUT) 287 + $(MAKE) -C $(BPFTOOLDIR) srctree=$(BPF_SAMPLES_PATH)/../../ \ 288 + OUTPUT=$(BPFTOOL_OUTPUT)/ bootstrap 291 289 292 290 $(LIBBPF_OUTPUT) $(BPFTOOL_OUTPUT): 293 291 $(call msg,MKDIR,$@)
+3 -4
tools/bpf/runqslower/Makefile
··· 4 4 OUTPUT ?= $(abspath .output)/ 5 5 6 6 BPFTOOL_OUTPUT := $(OUTPUT)bpftool/ 7 - DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bpftool 7 + DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bootstrap/bpftool 8 8 BPFTOOL ?= $(DEFAULT_BPFTOOL) 9 9 LIBBPF_SRC := $(abspath ../../lib/bpf) 10 10 BPFOBJ_OUTPUT := $(OUTPUT)libbpf/ ··· 86 86 $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) \ 87 87 DESTDIR=$(BPFOBJ_OUTPUT) prefix= $(abspath $@) install_headers 88 88 89 - $(DEFAULT_BPFTOOL): $(BPFOBJ) | $(BPFTOOL_OUTPUT) 90 - $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) \ 91 - ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) 89 + $(DEFAULT_BPFTOOL): | $(BPFTOOL_OUTPUT) 90 + $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) bootstrap