btf_decl_tag
static inline struct btf_decl_tag *btf_decl_tag(const struct btf_type *t)
return (struct btf_decl_tag *)(t + 1);
const struct btf_decl_tag *tag;
static const struct btf_decl_tag *btf_type_decl_tag(const struct btf_type *t)
return (const struct btf_decl_tag *)(t + 1);
const struct btf_decl_tag *tag = (const void *)(t + 1);
if (btf_decl_tag(t)->component_idx != -1)
if (btf_kflag(t) || btf_decl_tag(t)->component_idx != -1)
idx = btf_decl_tag(t)->component_idx;
#define __arg_ctx __attribute__((btf_decl_tag("arg:ctx")))
#define __arg_nonnull __attribute((btf_decl_tag("arg:nonnull")))
#define __arg_nullable __attribute((btf_decl_tag("arg:nullable")))
#define __arg_trusted __attribute((btf_decl_tag("arg:trusted")))
#define __arg_untrusted __attribute((btf_decl_tag("arg:untrusted")))
#define __arg_arena __attribute((btf_decl_tag("arg:arena")))
sz = sizeof(struct btf_type) + sizeof(struct btf_decl_tag);
btf_decl_tag(t)->component_idx = component_idx;
return base_size + sizeof(struct btf_decl_tag);
[BTF_KIND_DECL_TAG] = { sizeof(struct btf_decl_tag), 0, 0 },
btf_decl_tag(t)->component_idx = bswap_32(btf_decl_tag(t)->component_idx);
struct btf_decl_tag;
static inline struct btf_decl_tag *btf_decl_tag(const struct btf_type *t)
return (struct btf_decl_tag *)(t + 1);
if (!btf_is_decl_tag(t) || btf_decl_tag(t)->component_idx != -1)
arg_idx = btf_decl_tag(t)->component_idx;
#define __contains(name, node) __attribute__((btf_decl_tag("contains:" #name ":" #node)))
#define __contains(name, node) __attribute__((btf_decl_tag("contains:" #name ":" #node)))
#define __exception_cb(name) __attribute__((btf_decl_tag("exception_callback:" #name)))
t->type, btf_decl_tag(t)->component_idx);
#define __test_tag(tag) __attribute__((btf_decl_tag("comment:" XSTR(__COUNTER__) ":" tag)))
return base_size + sizeof(struct btf_decl_tag);
ASSERT_EQ(btf_decl_tag(t)->component_idx, -1, "tag_component_idx");
ASSERT_EQ(btf_decl_tag(t)->component_idx, 1, "tag_component_idx");
#define __test_tag(tag) __attribute__((btf_decl_tag("comment:" XSTR(__COUNTER__) ":" tag)))
#if __has_attribute(btf_decl_tag)
#define __tag1 __attribute__((btf_decl_tag("tag1")))
#define __tag2 __attribute__((btf_decl_tag("tag2")))
if (!btf_is_decl_tag(t) || t->type != id || btf_decl_tag(t)->component_idx != -1)