diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2023-02-15 00:12:16 +0100 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2023-02-16 15:32:45 -0800 |
commit | 38f0408ef756e738387f7d8f62b8d58ca5938da4 (patch) | |
tree | d29cd0b378e4dba10f0f6c0c981ea9a37944ecd4 /tools/bpf/bpftool/btf_dumper.c | |
parent | 629dfc660cae86a6a48d19f5295226d03caae673 (diff) | |
download | linux-38f0408ef756e738387f7d8f62b8d58ca5938da4.tar.gz linux-38f0408ef756e738387f7d8f62b8d58ca5938da4.tar.bz2 linux-38f0408ef756e738387f7d8f62b8d58ca5938da4.zip |
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
Diffstat (limited to 'tools/bpf/bpftool/btf_dumper.c')
-rw-r--r-- | tools/bpf/bpftool/btf_dumper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c index eda71fdfe95a..e7f6ec3a8f35 100644 --- a/tools/bpf/bpftool/btf_dumper.c +++ b/tools/bpf/bpftool/btf_dumper.c @@ -57,7 +57,7 @@ static int dump_prog_id_as_func_ptr(const struct btf_dumper *d, if (prog_fd < 0) goto print; - err = bpf_obj_get_info_by_fd(prog_fd, &info, &info_len); + err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len); if (err) goto print; @@ -70,7 +70,7 @@ static int dump_prog_id_as_func_ptr(const struct btf_dumper *d, info.func_info_rec_size = finfo_rec_size; info.func_info = ptr_to_u64(&finfo); - err = bpf_obj_get_info_by_fd(prog_fd, &info, &info_len); + err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len); if (err) goto print; |