Commit 7a255ae7 authored by Yafang Shao's avatar Yafang Shao Committed by Daniel Borkmann

bpftool: Show also the name of type BPF_OBJ_LINK

For example, /sys/fs/bpf/maps.debug is a BPF link. When you run `bpftool map show`
to show it:

Before:

  $ bpftool map show pinned /sys/fs/bpf/maps.debug
  Error: incorrect object type: unknown

After:

  $ bpftool map show pinned /sys/fs/bpf/maps.debug
  Error: incorrect object type: link
Signed-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: default avatarQuentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220629154832.56986-5-laoar.shao@gmail.com
parent 39e940d4
...@@ -316,6 +316,7 @@ const char *get_fd_type_name(enum bpf_obj_type type) ...@@ -316,6 +316,7 @@ const char *get_fd_type_name(enum bpf_obj_type type)
[BPF_OBJ_UNKNOWN] = "unknown", [BPF_OBJ_UNKNOWN] = "unknown",
[BPF_OBJ_PROG] = "prog", [BPF_OBJ_PROG] = "prog",
[BPF_OBJ_MAP] = "map", [BPF_OBJ_MAP] = "map",
[BPF_OBJ_LINK] = "link",
}; };
if (type < 0 || type >= ARRAY_SIZE(names) || !names[type]) if (type < 0 || type >= ARRAY_SIZE(names) || !names[type])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment