Commit 2019c583 authored by Ihor Solodrai's avatar Ihor Solodrai Committed by Andrii Nakryiko
Browse files

libbpf: Check the kflag of type tags in btf_dump



If the kflag is set for a BTF type tag, then the tag represents an
arbitrary __attribute__. Change btf_dump accordingly.

Signed-off-by: default avatarIhor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Reviewed-by: default avatarAlan Maguire <alan.maguire@oracle.com>
Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250130201239.1429648-4-ihor.solodrai@linux.dev
parent ea70faa1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1494,6 +1494,9 @@ static void btf_dump_emit_type_chain(struct btf_dump *d,
		case BTF_KIND_TYPE_TAG:
			btf_dump_emit_mods(d, decls);
			name = btf_name_of(d, t->name_off);
			if (btf_kflag(t))
				btf_dump_printf(d, " __attribute__((%s))", name);
			else
				btf_dump_printf(d, " __attribute__((btf_type_tag(\"%s\")))", name);
			break;
		case BTF_KIND_ARRAY: {