btf_enum
static inline struct btf_enum *btf_enum(const struct btf_type *t)
return (struct btf_enum *)(t + 1);
const struct btf_enum *enums = btf_type_enum(t);
const struct btf_enum *enums = btf_type_enum(t);
static const struct btf_enum *btf_type_enum(const struct btf_type *t)
return (const struct btf_enum *)(t + 1);
const struct btf_enum *e;
e = &btf_enum(enum_t)[i];
const struct btf_enum *e;
e = &btf_enum(enum_t)[i];
const struct btf_enum *v = (const void *)(t + 1);
btf_enum(t)->name_off;
btf_enum(t)[i].name_off :
const struct btf_enum *enums = btf_enum(t);
struct btf_enum *v;
sz = sizeof(struct btf_enum);
return base_size + vlen * sizeof(struct btf_enum);
struct btf_enum *e;
for (i = 0, e = btf_enum(t); i < vlen; i++, e++) {
const struct btf_enum *m1, *m2;
m1 = btf_enum(t1);
m2 = btf_enum(t2);
const struct btf_enum *m = btf_enum(t);
static inline struct btf_enum *btf_enum(const struct btf_type *t)
return (struct btf_enum *)(t + 1);
const struct btf_enum *v = btf_enum(t);
const struct btf_enum *e;
for (i = 0, e = btf_enum(t); i < btf_vlen(t); i++, e++) {
sizeof(struct btf_enum),
1, {offsetof(struct btf_enum, name_off)}
const struct btf_enum *e = btf_enum(t);
const struct btf_enum *e;
e = btf_enum(t) + spec->raw_spec[0];
local_n_off = btf_is_enum(local_t) ? btf_enum(local_t)[i].name_off :
targ_n_off = btf_is_enum(targ_t) ? btf_enum(targ_t)[j].name_off :
name_off = btf_is_enum(t) ? btf_enum(t)[access_idx].name_off
name_off = btf_enum(targ_type)[i].name_off;
*val = btf_enum(t)[spec->spec[0].idx].val;
struct btf_enum *be = btf_enum(type);
struct btf_enum *be = btf_enum(bt);
struct btf_enum *e = btf_enum(t);
const struct btf_enum *v = btf_enum(t);
return base_size + vlen * sizeof(struct btf_enum);
TEST_BTF_DUMP_DATA_C(btf, d, "struct", str, struct btf_enum, BTF_F_COMPACT,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, 0,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, BTF_F_COMPACT,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, 0,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum,
TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum,
const struct btf_enum *v;
v = btf_enum(t) + 0;
v = btf_enum(t) + 1;
(name = btf__name_by_offset(local_btf, btf_enum(t)[0].name_off)) &&
const struct btf_enum *e;
for (e = btf_enum(t), i = 0, n = btf_vlen(t); i < n; e++, i++) {
const struct btf_enum *e;
for (e = btf_enum(t), i = 0, n = btf_vlen(t); i < n; e++, i++) {
const struct btf_enum *e;
e = btf_enum(t);
const struct btf_enum *e;
e = btf_enum(t);
const struct btf_enum *e;
e = btf_enum(t);
const struct btf_enum *e;
e = btf_enum(t);
TEST_BTF_C(str, struct btf_enum, 0,
TEST_BTF(str, struct btf_enum, BTF_F_NONAME, "{3,-1,}",
TEST_BTF(str, struct btf_enum, BTF_F_NONAME, "{-1,}",
TEST_BTF(str, struct btf_enum, BTF_F_NONAME|BTF_F_ZERO, "{0,-1,}",
TEST_BTF(str, struct btf_enum, 0, "(struct btf_enum){}",
TEST_BTF(str, struct btf_enum, BTF_F_NONAME, "{}",
TEST_BTF(str, struct btf_enum, BTF_F_ZERO,
const struct btf_enum *e;
e = btf_enum(t);
struct btf_enum *e = btf_enum(t);