bpftool: Use bpf_{btf,link,map,prog}_get_info_by_fd()
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 14 Feb 2023 23:12:16 +0000 (00:12 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 16 Feb 2023 23:32:45 +0000 (15:32 -0800)
commit38f0408ef756e738387f7d8f62b8d58ca5938da4
treed29cd0b378e4dba10f0f6c0c981ea9a37944ecd4
parent629dfc660cae86a6a48d19f5295226d03caae673
bpftool: Use bpf_{btf,link,map,prog}_get_info_by_fd()

Use the new type-safe wrappers around bpf_obj_get_info_by_fd().

Split the bpf_obj_get_info_by_fd() call in build_btf_type_table() in
two, since knowing the type helps with the Memory Sanitizer.

Improve map_parse_fd_and_info() type safety by using
struct bpf_map_info * instead of void * for info.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20230214231221.249277-4-iii@linux.ibm.com
tools/bpf/bpftool/btf.c
tools/bpf/bpftool/btf_dumper.c
tools/bpf/bpftool/cgroup.c
tools/bpf/bpftool/common.c
tools/bpf/bpftool/link.c
tools/bpf/bpftool/main.h
tools/bpf/bpftool/map.c
tools/bpf/bpftool/prog.c
tools/bpf/bpftool/struct_ops.c