]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add BTF_KIND_FLOAT support
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 26 Feb 2021 20:22:49 +0000 (21:22 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 5 Mar 2021 01:58:15 +0000 (17:58 -0800)
commit22541a9eeb0d968c133aaebd95fa59da3208e705
tree72eafa0a782827717a18cb087359ec480bf9e83c
parent1b1ce92b24331b569a444858fc487a1ca19dc778
libbpf: Add BTF_KIND_FLOAT support

The logic follows that of BTF_KIND_INT most of the time. Sanitization
replaces BTF_KIND_FLOATs with equally-sized empty BTF_KIND_STRUCTs on
older kernels, for example, the following:

    [4] FLOAT 'float' size=4

becomes the following:

    [4] STRUCT '(anon)' size=4 vlen=0

With dwarves patch [1] and this patch, the older kernels, which were
failing with the floating-point-related errors, will now start working
correctly.

[1] https://github.com/iii-i/dwarves/commit/btf-kind-float-v2

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210226202256.116518-4-iii@linux.ibm.com
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/btf_dump.c
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.map
tools/lib/bpf/libbpf_internal.h