]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: split initialization and loading of BTF
authorAndrii Nakryiko <andriin@fb.com>
Mon, 17 Jun 2019 19:26:55 +0000 (12:26 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Jun 2019 22:10:41 +0000 (00:10 +0200)
commit9bc41bd3e9cba2fa454cbd8e61ef3bc934286bf1
tree866c9d1246da8901607b84b20eed09849d83e0b8
parent9972e34ba9c223dd399dc114966e0df16e92de9f
libbpf: split initialization and loading of BTF

Libbpf does sanitization of BTF before loading it into kernel, if kernel
doesn't support some of newer BTF features. This removes some of the
important information from BTF (e.g., DATASEC and VAR description),
which will be used for map construction. This patch splits BTF
processing into initialization step, in which BTF is initialized from
ELF and all the original data is still preserved; and
sanitization/loading step, which ensures that BTF is safe to load into
kernel. This allows to use full BTF information to construct maps, while
still loading valid BTF into older kernels.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c