]> git.baikalelectronics.ru Git - kernel.git/commit
tools/bpf: add support to read .BTF.ext sections
authorYonghong Song <yhs@fb.com>
Mon, 19 Nov 2018 23:29:16 +0000 (15:29 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 20 Nov 2018 18:54:39 +0000 (10:54 -0800)
commitac7144f45935009cda86d5fc67eb5d968844a71f
tree15c44288f87b0cb93cbfc6012e0094fc106ecdd7
parent139ea72e80c8e64f5cc24bed074fe8b3ee176420
tools/bpf: add support to read .BTF.ext sections

The .BTF section is already available to encode types.
These types can be used for map
pretty print. The whole .BTF will be passed to the
kernel as well for which kernel can verify and return
to the user space for pretty print etc.

The llvm patch at https://reviews.llvm.org/D53736
will generate .BTF section and one more section .BTF.ext.
The .BTF.ext section encodes function type
information and line information. Note that
this patch set only supports function type info.
The functionality is implemented in libbpf.

The .BTF section can be directly loaded into the
kernel, and the .BTF.ext section cannot. The loader
may need to do some relocation and merging,
similar to merging multiple code sections, before
loading into the kernel.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/bpf.c
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.c