Lines Matching refs:t
93 static const char *btf_func_linkage_str(const struct btf_type *t) in btf_func_linkage_str() argument
95 switch (btf_vlen(t)) { in btf_func_linkage_str()
120 const struct btf_type *t) in dump_btf_type() argument
123 int kind = btf_kind(t); in dump_btf_type()
129 jsonw_string_field(w, "name", btf_str(btf, t->name_off)); in dump_btf_type()
132 btf_str(btf, t->name_off)); in dump_btf_type()
137 __u32 v = *(__u32 *)(t + 1); in dump_btf_type()
143 jsonw_uint_field(w, "size", t->size); in dump_btf_type()
149 t->size, BTF_INT_OFFSET(v), BTF_INT_BITS(v), in dump_btf_type()
161 jsonw_uint_field(w, "type_id", t->type); in dump_btf_type()
163 printf(" type_id=%u", t->type); in dump_btf_type()
166 const struct btf_array *arr = (const void *)(t + 1); in dump_btf_type()
180 const struct btf_member *m = (const void *)(t + 1); in dump_btf_type()
181 __u16 vlen = BTF_INFO_VLEN(t->info); in dump_btf_type()
185 jsonw_uint_field(w, "size", t->size); in dump_btf_type()
190 printf(" size=%u vlen=%u", t->size, vlen); in dump_btf_type()
196 if (BTF_INFO_KFLAG(t->info)) { in dump_btf_type()
226 const struct btf_enum *v = (const void *)(t + 1); in dump_btf_type()
227 __u16 vlen = BTF_INFO_VLEN(t->info); in dump_btf_type()
231 encoding = btf_kflag(t) ? "SIGNED" : "UNSIGNED"; in dump_btf_type()
234 jsonw_uint_field(w, "size", t->size); in dump_btf_type()
239 printf(" encoding=%s size=%u vlen=%u", encoding, t->size, vlen); in dump_btf_type()
247 if (btf_kflag(t)) in dump_btf_type()
253 if (btf_kflag(t)) in dump_btf_type()
264 const struct btf_enum64 *v = btf_enum64(t); in dump_btf_type()
265 __u16 vlen = btf_vlen(t); in dump_btf_type()
269 encoding = btf_kflag(t) ? "SIGNED" : "UNSIGNED"; in dump_btf_type()
272 jsonw_uint_field(w, "size", t->size); in dump_btf_type()
277 printf(" encoding=%s size=%u vlen=%u", encoding, t->size, vlen); in dump_btf_type()
286 if (btf_kflag(t)) in dump_btf_type()
292 if (btf_kflag(t)) in dump_btf_type()
305 const char *fwd_kind = BTF_INFO_KFLAG(t->info) ? "union" in dump_btf_type()
315 const char *linkage = btf_func_linkage_str(t); in dump_btf_type()
318 jsonw_uint_field(w, "type_id", t->type); in dump_btf_type()
321 printf(" type_id=%u linkage=%s", t->type, linkage); in dump_btf_type()
326 const struct btf_param *p = (const void *)(t + 1); in dump_btf_type()
327 __u16 vlen = BTF_INFO_VLEN(t->info); in dump_btf_type()
331 jsonw_uint_field(w, "ret_type_id", t->type); in dump_btf_type()
336 printf(" ret_type_id=%u vlen=%u", t->type, vlen); in dump_btf_type()
355 const struct btf_var *v = (const void *)(t + 1); in dump_btf_type()
361 jsonw_uint_field(w, "type_id", t->type); in dump_btf_type()
364 printf(" type_id=%u, linkage=%s", t->type, linkage); in dump_btf_type()
369 const struct btf_var_secinfo *v = (const void *)(t + 1); in dump_btf_type()
371 __u16 vlen = BTF_INFO_VLEN(t->info); in dump_btf_type()
375 jsonw_uint_field(w, "size", t->size); in dump_btf_type()
380 printf(" size=%u vlen=%u", t->size, vlen); in dump_btf_type()
407 jsonw_uint_field(w, "size", t->size); in dump_btf_type()
409 printf(" size=%u", t->size); in dump_btf_type()
413 const struct btf_decl_tag *tag = (const void *)(t + 1); in dump_btf_type()
416 jsonw_uint_field(w, "type_id", t->type); in dump_btf_type()
419 printf(" type_id=%u component_idx=%d", t->type, tag->component_idx); in dump_btf_type()
438 const struct btf_type *t; in dump_btf_raw() local
449 t = btf__type_by_id(btf, root_type_ids[i]); in dump_btf_raw()
450 dump_btf_type(btf, root_type_ids[i], t); in dump_btf_raw()
462 t = btf__type_by_id(btf, i); in dump_btf_raw()
463 dump_btf_type(btf, i, t); in dump_btf_raw()
524 const struct btf_type *t = btf__type_by_id(btf, i); in dump_btf_kfuncs() local
528 if (!btf_is_decl_tag(t)) in dump_btf_kfuncs()
531 if (btf_decl_tag(t)->component_idx != -1) in dump_btf_kfuncs()
534 ft = btf__type_by_id(btf, t->type); in dump_btf_kfuncs()
538 name = btf__name_by_offset(btf, t->name_off); in dump_btf_kfuncs()
555 const struct btf_type *t = kfuncs.elems[i]; in dump_btf_kfuncs() local
561 if (fastcalls.elems[j] == t) { in dump_btf_kfuncs()
567 opts.field_name = btf__name_by_offset(btf, t->name_off); in dump_btf_kfuncs()
568 err = btf_dump__emit_type_decl(d, t->type, &opts); in dump_btf_kfuncs()
591 const struct btf_type *t = btf__type_by_id(btf, index); in btf_type_rank() local
592 const int kind = btf_kind(t); in btf_type_rank()
595 if (t->name_off) in btf_type_rank()
612 return btf_type_rank(btf, btf_array(t)->type, has_name); in btf_type_rank()
622 return btf_type_rank(btf, t->type, has_name); in btf_type_rank()
631 const struct btf_type *t = btf__type_by_id(btf, index); in btf_type_sort_name() local
633 switch (btf_kind(t)) { in btf_type_sort_name()
636 int name_off = t->name_off; in btf_type_sort_name()
638 if (!from_ref && !name_off && btf_vlen(t)) in btf_type_sort_name()
639 name_off = btf_kind(t) == BTF_KIND_ENUM64 ? in btf_type_sort_name()
640 btf_enum64(t)->name_off : in btf_type_sort_name()
641 btf_enum(t)->name_off; in btf_type_sort_name()
646 return btf_type_sort_name(btf, btf_array(t)->type, true); in btf_type_sort_name()
654 return btf_type_sort_name(btf, t->type, true); in btf_type_sort_name()
656 return btf__name_by_offset(btf, t->name_off); in btf_type_sort_name()
676 const struct btf_type *t = btf__type_by_id(btf, id); in btf_type_disambig_hash() local
680 hash = btf_name_hasher(hash, btf, t->name_off); in btf_type_disambig_hash()
682 switch (btf_kind(t)) { in btf_type_disambig_hash()
685 for (i = 0; i < btf_vlen(t); i++) { in btf_type_disambig_hash()
686 __u32 name_off = btf_is_enum(t) ? in btf_type_disambig_hash()
687 btf_enum(t)[i].name_off : in btf_type_disambig_hash()
688 btf_enum64(t)[i].name_off; in btf_type_disambig_hash()
697 for (i = 0; i < btf_vlen(t); i++) { in btf_type_disambig_hash()
698 const struct btf_member *m = btf_members(t) + i; in btf_type_disambig_hash()
712 hash = hasher(hash, btf_type_disambig_hash(btf, t->type, include_members)); in btf_type_disambig_hash()
715 struct btf_array *arr = btf_array(t); in btf_type_disambig_hash()
757 const struct btf_type *t = btf__type_by_id(btf, i); in sort_btf_c() local
762 d->own_name = btf__name_by_offset(btf, t->name_off); in sort_btf_c()