From: Andrii Nakryiko Date: Wed, 2 Dec 2020 06:52:41 +0000 (-0800) Subject: tools/bpftool: Emit name for anonymous BTFs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=71ccb50074f31a50a1da4c1d8306d54da0907b00;p=linux.git tools/bpftool: Emit name for anonymous BTFs For consistency of output, emit "name " for BTFs without the name. This keeps output more consistent and obvious. Suggested-by: Song Liu Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20201202065244.530571-2-andrii@kernel.org --- diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index ed5e971572414..bd46af6a61ccc 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -750,6 +750,8 @@ show_btf_plain(struct bpf_btf_info *info, int fd, printf("name [%s] ", name); else if (name && name[0]) printf("name %s ", name); + else + printf("name "); printf("size %uB", info->btf_size); n = 0;