]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libbpf: Introduce kflag for type_tags and decl_tags in BTF
authorIhor Solodrai <ihor.solodrai@linux.dev>
Thu, 30 Jan 2025 20:12:34 +0000 (12:12 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 6 Feb 2025 00:17:59 +0000 (16:17 -0800)
commit51d1b1d42841c557dabde5b140ae20774591e6dc
treed240b93fc34bd7db41970dbe247fe0db6e823e42
parent03f3aa4a6b664270d502c7fb44c634cbe250261e
libbpf: Introduce kflag for type_tags and decl_tags in BTF

Add the following functions to libbpf API:
  * btf__add_type_attr()
  * btf__add_decl_attr()

These functions allow to add to BTF the type tags and decl tags with
info->kflag set to 1. The kflag indicates that the tag directly
encodes an __attribute__ and not a normal tag.

See Documentation/bpf/btf.rst changes in the subsequent patch for
details on the semantics.

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250130201239.1429648-2-ihor.solodrai@linux.dev
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.map