• Home
  • Raw
  • Download

Lines Matching refs:t

44 static int btf_add_type(struct btf *btf, struct btf_type *t)  in btf_add_type()  argument
67 btf->types[++(btf->nr_types)] = t; in btf_add_type()
141 static int btf_type_size(struct btf_type *t) in btf_type_size() argument
144 __u16 vlen = btf_vlen(t); in btf_type_size()
146 switch (btf_kind(t)) { in btf_type_size()
171 pr_debug("Unsupported BTF_KIND:%u\n", btf_kind(t)); in btf_type_size()
184 struct btf_type *t = next_type; in btf_parse_type_sec() local
188 type_size = btf_type_size(t); in btf_parse_type_sec()
192 err = btf_add_type(btf, t); in btf_parse_type_sec()
213 static bool btf_type_is_void(const struct btf_type *t) in btf_type_is_void() argument
215 return t == &btf_void || btf_is_fwd(t); in btf_type_is_void()
218 static bool btf_type_is_void_or_null(const struct btf_type *t) in btf_type_is_void_or_null() argument
220 return !t || btf_type_is_void(t); in btf_type_is_void_or_null()
228 const struct btf_type *t; in btf__resolve_size() local
233 t = btf__type_by_id(btf, type_id); in btf__resolve_size()
234 for (i = 0; i < MAX_RESOLVE_DEPTH && !btf_type_is_void_or_null(t); in btf__resolve_size()
236 switch (btf_kind(t)) { in btf__resolve_size()
242 size = t->size; in btf__resolve_size()
252 type_id = t->type; in btf__resolve_size()
255 array = btf_array(t); in btf__resolve_size()
265 t = btf__type_by_id(btf, type_id); in btf__resolve_size()
279 const struct btf_type *t; in btf__resolve_type() local
282 t = btf__type_by_id(btf, type_id); in btf__resolve_type()
284 !btf_type_is_void_or_null(t) && in btf__resolve_type()
285 (btf_is_mod(t) || btf_is_typedef(t) || btf_is_var(t))) { in btf__resolve_type()
286 type_id = t->type; in btf__resolve_type()
287 t = btf__type_by_id(btf, type_id); in btf__resolve_type()
291 if (depth == MAX_RESOLVE_DEPTH || btf_type_is_void_or_null(t)) in btf__resolve_type()
305 const struct btf_type *t = btf->types[i]; in btf__find_by_name() local
306 const char *name = btf__name_by_offset(btf, t->name_off); in btf__find_by_name()
502 struct btf_type *t) in btf_fixup_datasec() argument
504 __u32 size = 0, off = 0, i, vars = btf_vlen(t); in btf_fixup_datasec()
505 const char *name = btf__name_by_offset(btf, t->name_off); in btf_fixup_datasec()
517 if (ret || !size || (t->size && t->size != size)) { in btf_fixup_datasec()
522 t->size = size; in btf_fixup_datasec()
524 for (i = 0, vsi = btf_var_secinfos(t); i < vars; i++, vsi++) { in btf_fixup_datasec()
552 qsort(t + 1, vars, sizeof(*vsi), compare_vsi_off); in btf_fixup_datasec()
562 struct btf_type *t = btf->types[i]; in btf__finalize_data() local
569 if (btf_is_datasec(t)) { in btf__finalize_data()
570 err = btf_fixup_datasec(obj, btf, t); in btf__finalize_data()
1414 struct btf_type *t = d->btf->types[i]; in btf_dedup_new() local
1417 if (btf_is_var(t) || btf_is_datasec(t)) in btf_dedup_new()
1450 struct btf_type *t; in btf_for_each_str_off() local
1453 t = d->btf->types[i]; in btf_for_each_str_off()
1454 r = fn(&t->name_off, ctx); in btf_for_each_str_off()
1458 switch (btf_kind(t)) { in btf_for_each_str_off()
1461 struct btf_member *m = btf_members(t); in btf_for_each_str_off()
1462 __u16 vlen = btf_vlen(t); in btf_for_each_str_off()
1473 struct btf_enum *m = btf_enum(t); in btf_for_each_str_off()
1474 __u16 vlen = btf_vlen(t); in btf_for_each_str_off()
1485 struct btf_param *m = btf_params(t); in btf_for_each_str_off()
1486 __u16 vlen = btf_vlen(t); in btf_for_each_str_off()
1720 static long btf_hash_common(struct btf_type *t) in btf_hash_common() argument
1724 h = hash_combine(0, t->name_off); in btf_hash_common()
1725 h = hash_combine(h, t->info); in btf_hash_common()
1726 h = hash_combine(h, t->size); in btf_hash_common()
1738 static long btf_hash_int(struct btf_type *t) in btf_hash_int() argument
1740 __u32 info = *(__u32 *)(t + 1); in btf_hash_int()
1743 h = btf_hash_common(t); in btf_hash_int()
1761 static long btf_hash_enum(struct btf_type *t) in btf_hash_enum() argument
1766 h = hash_combine(0, t->name_off); in btf_hash_enum()
1767 h = hash_combine(h, t->info & ~0xffff); in btf_hash_enum()
1768 h = hash_combine(h, t->size); in btf_hash_enum()
1794 static inline bool btf_is_enum_fwd(struct btf_type *t) in btf_is_enum_fwd() argument
1796 return btf_is_enum(t) && btf_vlen(t) == 0; in btf_is_enum_fwd()
1814 static long btf_hash_struct(struct btf_type *t) in btf_hash_struct() argument
1816 const struct btf_member *member = btf_members(t); in btf_hash_struct()
1817 __u32 vlen = btf_vlen(t); in btf_hash_struct()
1818 long h = btf_hash_common(t); in btf_hash_struct()
1861 static long btf_hash_array(struct btf_type *t) in btf_hash_array() argument
1863 const struct btf_array *info = btf_array(t); in btf_hash_array()
1864 long h = btf_hash_common(t); in btf_hash_array()
1911 static long btf_hash_fnproto(struct btf_type *t) in btf_hash_fnproto() argument
1913 const struct btf_param *member = btf_params(t); in btf_hash_fnproto()
1914 __u16 vlen = btf_vlen(t); in btf_hash_fnproto()
1915 long h = btf_hash_common(t); in btf_hash_fnproto()
1989 struct btf_type *t = d->btf->types[type_id]; in btf_dedup_prim_type() local
1997 switch (btf_kind(t)) { in btf_dedup_prim_type()
2013 h = btf_hash_int(t); in btf_dedup_prim_type()
2017 if (btf_equal_int(t, cand)) { in btf_dedup_prim_type()
2025 h = btf_hash_enum(t); in btf_dedup_prim_type()
2029 if (btf_equal_enum(t, cand)) { in btf_dedup_prim_type()
2035 if (btf_compat_enum(t, cand)) { in btf_dedup_prim_type()
2036 if (btf_is_enum_fwd(t)) { in btf_dedup_prim_type()
2048 h = btf_hash_common(t); in btf_dedup_prim_type()
2052 if (btf_equal_common(t, cand)) { in btf_dedup_prim_type()
2123 static inline __u16 btf_fwd_kind(struct btf_type *t) in btf_fwd_kind() argument
2125 return btf_kflag(t) ? BTF_KIND_UNION : BTF_KIND_STRUCT; in btf_fwd_kind()
2454 struct btf_type *cand_type, *t; in btf_dedup_struct_type() local
2465 t = d->btf->types[type_id]; in btf_dedup_struct_type()
2466 kind = btf_kind(t); in btf_dedup_struct_type()
2471 h = btf_hash_struct(t); in btf_dedup_struct_type()
2487 if (!btf_shallow_equal_struct(t, cand_type)) in btf_dedup_struct_type()
2548 struct btf_type *t, *cand; in btf_dedup_ref_type() local
2558 t = d->btf->types[type_id]; in btf_dedup_ref_type()
2561 switch (btf_kind(t)) { in btf_dedup_ref_type()
2568 ref_type_id = btf_dedup_ref_type(d, t->type); in btf_dedup_ref_type()
2571 t->type = ref_type_id; in btf_dedup_ref_type()
2573 h = btf_hash_common(t); in btf_dedup_ref_type()
2577 if (btf_equal_common(t, cand)) { in btf_dedup_ref_type()
2585 struct btf_array *info = btf_array(t); in btf_dedup_ref_type()
2597 h = btf_hash_array(t); in btf_dedup_ref_type()
2601 if (btf_equal_array(t, cand)) { in btf_dedup_ref_type()
2614 ref_type_id = btf_dedup_ref_type(d, t->type); in btf_dedup_ref_type()
2617 t->type = ref_type_id; in btf_dedup_ref_type()
2619 vlen = btf_vlen(t); in btf_dedup_ref_type()
2620 param = btf_params(t); in btf_dedup_ref_type()
2629 h = btf_hash_fnproto(t); in btf_dedup_ref_type()
2633 if (btf_equal_fnproto(t, cand)) { in btf_dedup_ref_type()
2757 struct btf_type *t = d->btf->types[type_id]; in btf_dedup_remap_type() local
2760 switch (btf_kind(t)) { in btf_dedup_remap_type()
2773 r = btf_dedup_remap_type_id(d, t->type); in btf_dedup_remap_type()
2776 t->type = r; in btf_dedup_remap_type()
2780 struct btf_array *arr_info = btf_array(t); in btf_dedup_remap_type()
2795 struct btf_member *member = btf_members(t); in btf_dedup_remap_type()
2796 __u16 vlen = btf_vlen(t); in btf_dedup_remap_type()
2809 struct btf_param *param = btf_params(t); in btf_dedup_remap_type()
2810 __u16 vlen = btf_vlen(t); in btf_dedup_remap_type()
2812 r = btf_dedup_remap_type_id(d, t->type); in btf_dedup_remap_type()
2815 t->type = r; in btf_dedup_remap_type()
2828 struct btf_var_secinfo *var = btf_var_secinfos(t); in btf_dedup_remap_type()
2829 __u16 vlen = btf_vlen(t); in btf_dedup_remap_type()