diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-07-21 21:38:04 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-25 20:15:32 -0700 |
commit | f3c93a93b564d25cab715cd71a6c3417e77b19f3 (patch) | |
tree | d342bd7d72555daab45f55de1167102e3989114d /tools | |
parent | a57066b1a01977a646145f4ce8dfb4538b08368a (diff) | |
download | linux-f3c93a93b564d25cab715cd71a6c3417e77b19f3.tar.gz linux-f3c93a93b564d25cab715cd71a6c3417e77b19f3.tar.bz2 linux-f3c93a93b564d25cab715cd71a6c3417e77b19f3.zip |
tools/bpftool: Strip BPF .o files before skeleton generation
Strip away DWARF info from .bpf.o files, before generating BPF skeletons.
This reduces bpftool binary size from 3.43MB to 2.58MB.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20200722043804.2373298-1-andriin@fb.com
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bpf/bpftool/Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 51bd520ed437..8462690a039b 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -59,6 +59,7 @@ endif INSTALL ?= install RM ?= rm -f CLANG ?= clang +LLVM_STRIP ?= llvm-strip FEATURE_USER = .bpftool FEATURE_TESTS = libbfd disassembler-four-args reallocarray zlib libcap \ @@ -147,7 +148,7 @@ $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF) -I$(srctree)/tools/include/uapi/ \ -I$(LIBBPF_PATH) \ -I$(srctree)/tools/lib \ - -g -O2 -target bpf -c $< -o $@ + -g -O2 -target bpf -c $< -o $@ && $(LLVM_STRIP) -g $@ $(OUTPUT)%.skel.h: $(OUTPUT)%.bpf.o $(BPFTOOL_BOOTSTRAP) $(QUIET_GEN)$(BPFTOOL_BOOTSTRAP) gen skeleton $< > $@ |