]> git.baikalelectronics.ru Git - kernel.git/commit
btf: add BTF types deduplication algorithm
authorAndrii Nakryiko <andriin@fb.com>
Tue, 5 Feb 2019 01:29:45 +0000 (17:29 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 5 Feb 2019 15:52:57 +0000 (16:52 +0100)
commit9424b59113ed9d950cc5cf1e5cf71057222266b4
treeaa8f77aa92737d225574fe536014e9d49ff28b29
parent606d46d4a0d9e2cd6e6dc33a09a30b7c0bc99fe9
btf: add BTF types deduplication algorithm

This patch implements BTF types deduplication algorithm. It allows to
greatly compress typical output of pahole's DWARF-to-BTF conversion or
LLVM's compilation output by detecting and collapsing identical types emitted in
isolation per compilation unit. Algorithm also resolves struct/union forward
declarations into concrete BTF types representing referenced struct/union. If
undesired, this resolution can be disabled through specifying corresponding options.

Algorithm itself and its application to Linux kernel's BTF types is
described in details at:
https://facebookmicrosites.github.io/bpf/blog/2018/11/14/btf-enhancement.html

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.map