OSDN Git Service

Merge branch 'bpf-btf-dedup'
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 5 Feb 2019 15:52:58 +0000 (16:52 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 5 Feb 2019 15:52:58 +0000 (16:52 +0100)
commit31de389707c8842ce71eaa8eff1eb74a43d5ef30
treefe630450860cda33ac53bae54ad2bcb3247b6c9a
parenta8a1f7d09cfc7e18874786c7634c9e71384fcd4e
parent9c651127445c2fb3dca7b000bce6de97290288ff
Merge branch 'bpf-btf-dedup'

Andrii Nakryiko says:

====================
This patch series adds BTF deduplication algorithm to libbpf. This algorithm
allows to take BTF type information containing duplicate per-compilation unit
information and reduce it to equivalent set of BTF types with no duplication without
loss of information. It also deduplicates strings and removes those strings that
are not referenced from any BTF type (and line information in .BTF.ext section,
if any).

Algorithm also resolves struct/union forward declarations into concrete BTF types
across multiple compilation units to facilitate better deduplication ratio. If
undesired, this resolution can be disabled through specifying corresponding options.

When applied to BTF data emitted by pahole's DWARF->BTF converter, it reduces
the overall size of .BTF section by about 65x, from about 112MB to 1.75MB, leaving
only 29247 out of initial 3073497 BTF type descriptors.

Algorithm with minor differences and preliminary results before FUNC/FUNC_PROTO
support is also described more verbosely at:

https://facebookmicrosites.github.io/bpf/blog/2018/11/14/btf-enhancement.html

v1->v2:
- rebase on latest bpf-next
- err_log/elog -> pr_debug
- btf__dedup, btf__get_strings, btf__get_nr_types listed under 0.0.2 version
====================

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>