[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201202065244.530571-2-andrii@kernel.org>
Date: Tue, 1 Dec 2020 22:52:41 -0800
From: Andrii Nakryiko <andrii@...nel.org>
To: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>, <ast@...com>,
<daniel@...earbox.net>
CC: <andrii@...nel.org>, <kernel-team@...com>,
Song Liu <songliubraving@...com>
Subject: [PATCH bpf-next 1/3] tools/bpftool: emit name <anon> for anonymous BTFs
For consistency of output, emit "name <anon>" for BTFs without the name. This
keeps output more consistent and obvious.
Suggested-by: Song Liu <songliubraving@...com>
Signed-off-by: Andrii Nakryiko <andrii@...nel.org>
---
tools/bpf/bpftool/btf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
index ed5e97157241..bd46af6a61cc 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 <anon> ");
printf("size %uB", info->btf_size);
n = 0;
--
2.24.1
Powered by blists - more mailing lists