aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/link.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <[email protected]>2023-02-14 23:12:16 +0000
committerAndrii Nakryiko <[email protected]>2023-02-16 23:32:45 +0000
commit38f0408ef756e738387f7d8f62b8d58ca5938da4 (patch)
treed29cd0b378e4dba10f0f6c0c981ea9a37944ecd4 /tools/bpf/bpftool/link.c
parentlibbpf: Use bpf_{btf,link,map,prog}_get_info_by_fd() (diff)
downloadkernel-38f0408ef756e738387f7d8f62b8d58ca5938da4.tar.gz
kernel-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 <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Reviewed-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/link.c')
-rw-r--r--tools/bpf/bpftool/link.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
index 6f4cfe01cad4..f985b79cca27 100644
--- a/tools/bpf/bpftool/link.c
+++ b/tools/bpf/bpftool/link.c
@@ -145,7 +145,7 @@ static int get_prog_info(int prog_id, struct bpf_prog_info *info)
return prog_fd;
memset(info, 0, sizeof(*info));
- err = bpf_obj_get_info_by_fd(prog_fd, info, &len);
+ err = bpf_prog_get_info_by_fd(prog_fd, info, &len);
if (err)
p_err("can't get prog info: %s", strerror(errno));
close(prog_fd);
@@ -327,7 +327,7 @@ static int do_show_link(int fd)
memset(&info, 0, sizeof(info));
again:
- err = bpf_obj_get_info_by_fd(fd, &info, &len);
+ err = bpf_link_get_info_by_fd(fd, &info, &len);
if (err) {
p_err("can't get link info: %s",
strerror(errno));