From: Yafang Shao Date: Wed, 29 Jun 2022 15:48:32 +0000 (+0000) Subject: bpftool: Show also the name of type BPF_OBJ_LINK X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7a255ae77216237a4ce83ddea595aa4e0a812f46;p=linux.git 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 Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220629154832.56986-5-laoar.shao@gmail.com --- diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index fc8172a4969ae..067e9ea59e3b0 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -316,6 +316,7 @@ const char *get_fd_type_name(enum bpf_obj_type type) [BPF_OBJ_UNKNOWN] = "unknown", [BPF_OBJ_PROG] = "prog", [BPF_OBJ_MAP] = "map", + [BPF_OBJ_LINK] = "link", }; if (type < 0 || type >= ARRAY_SIZE(names) || !names[type])