Skip to content

Commit 8eab0a0

Browse files
committed
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>
2 parents a2a5580 + 3848636 commit 8eab0a0

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

kernel/bpf/preload/iterators/Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LLVM_STRIP ?= llvm-strip
99
TOOLS_PATH := $(abspath ../../../../tools)
1010
BPFTOOL_SRC := $(TOOLS_PATH)/bpf/bpftool
1111
BPFTOOL_OUTPUT := $(abs_out)/bpftool
12-
DEFAULT_BPFTOOL := $(OUTPUT)/sbin/bpftool
12+
DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool
1313
BPFTOOL ?= $(DEFAULT_BPFTOOL)
1414

1515
LIBBPF_SRC := $(TOOLS_PATH)/lib/bpf
@@ -61,9 +61,5 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU
6161
OUTPUT=$(abspath $(dir $@))/ prefix= \
6262
DESTDIR=$(LIBBPF_DESTDIR) $(abspath $@) install_headers
6363

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

samples/bpf/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,10 @@ $(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU
282282

283283
BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool
284284
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
291289

292290
$(LIBBPF_OUTPUT) $(BPFTOOL_OUTPUT):
293291
$(call msg,MKDIR,$@)

tools/bpf/runqslower/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include ../../scripts/Makefile.include
44
OUTPUT ?= $(abspath .output)/
55

66
BPFTOOL_OUTPUT := $(OUTPUT)bpftool/
7-
DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bpftool
7+
DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bootstrap/bpftool
88
BPFTOOL ?= $(DEFAULT_BPFTOOL)
99
LIBBPF_SRC := $(abspath ../../lib/bpf)
1010
BPFOBJ_OUTPUT := $(OUTPUT)libbpf/
@@ -86,6 +86,5 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(BPFOBJ_OU
8686
$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) \
8787
DESTDIR=$(BPFOBJ_OUTPUT) prefix= $(abspath $@) install_headers
8888

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

0 commit comments

Comments
 (0)