mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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: Yafang Shao <laoar.shao@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20220629154832.56986-5-laoar.shao@gmail.com
This commit is contained in:
parent
39e940d4ab
commit
7a255ae772
1 changed files with 1 additions and 0 deletions
|
@ -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])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue