From a28de89bf9c40200cd01ebda5b0c66bffc86c8b3 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Wed, 24 Aug 2022 11:19:43 +0800 Subject: [PATCH] tools/bpftool: Emit name for anonymous BTFs mainline inclusion from mainline-5.11-rc1 commit 71ccb50074f31a50a1da4c1d8306d54da0907b00 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=71ccb50074f31a50a1da4c1d8306d54da0907b00 ------------------------------------------------- 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 (cherry picked from commit 71ccb50074f31a50a1da4c1d8306d54da0907b00) Signed-off-by: Wang Yufen --- 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 3dc13419a2df..aec4e92f8ea7 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -754,6 +754,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; -- GitLab