From 426c84de35c87d12dfc65a96711bdbd537bb44c5 Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Wed, 24 Aug 2022 11:25:10 +0800 Subject: [PATCH] bpftool: Support BTF_KIND_TYPE_TAG mainline inclusion from mainline-5.17-rc1 commit 3da5ba6f0509ace03cad38b554c89797129e90be 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=3da5ba6f0509ace03cad38b554c89797129e90be ------------------------------------------------- Add bpftool support for BTF_KIND_TYPE_TAG. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012620.1505506-1-yhs@fb.com (cherry picked from commit 3da5ba6f0509ace03cad38b554c89797129e90be) 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 52cb61ef7331..e46c60a1d7aa 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -37,6 +37,7 @@ static const char * const btf_kind_str[NR_BTF_KINDS] = { [BTF_KIND_VAR] = "VAR", [BTF_KIND_DATASEC] = "DATASEC", [BTF_KIND_DECL_TAG] = "DECL_TAG", + [BTF_KIND_TYPE_TAG] = "TYPE_TAG", }; struct btf_attach_table { @@ -141,6 +142,7 @@ static int dump_btf_type(const struct btf *btf, __u32 id, case BTF_KIND_VOLATILE: case BTF_KIND_RESTRICT: case BTF_KIND_TYPEDEF: + case BTF_KIND_TYPE_TAG: if (json_output) jsonw_uint_field(w, "type_id", t->type); else -- GitLab