Lines Matching refs:btf
125 struct btf *btf, in codegen_datasec_def() argument
130 const char *sec_name = btf__name_by_offset(btf, sec->name_off); in codegen_datasec_def()
144 const struct btf_type *var = btf__type_by_id(btf, sec_var->type); in codegen_datasec_def()
145 const char *var_name = btf__name_by_offset(btf, var->name_off); in codegen_datasec_def()
164 align = btf__align_of(btf, var->type); in codegen_datasec_def()
212 static const struct btf_type *find_type_for_map(struct btf *btf, const char *map_ident) in find_type_for_map() argument
214 int n = btf__type_cnt(btf), i; in find_type_for_map()
218 const struct btf_type *t = btf__type_by_id(btf, i); in find_type_for_map()
224 name = btf__str_by_offset(btf, t->name_off); in find_type_for_map()
247 struct btf *btf = bpf_object__btf(obj); in codegen_datasecs() local
254 d = btf_dump__new(btf, codegen_btf_dump_printf, NULL, NULL); in codegen_datasecs()
263 sec = find_type_for_map(btf, map_ident); in codegen_datasecs()
276 err = codegen_datasec_def(obj, btf, d, sec, obj_name); in codegen_datasecs()
288 static bool btf_is_ptr_to_func_proto(const struct btf *btf, in btf_is_ptr_to_func_proto() argument
291 return btf_is_ptr(v) && btf_is_func_proto(btf__type_by_id(btf, v->type)); in btf_is_ptr_to_func_proto()
296 struct btf *btf = bpf_object__btf(obj); in codegen_subskel_datasecs() local
307 d = btf_dump__new(btf, codegen_btf_dump_printf, NULL, NULL); in codegen_subskel_datasecs()
316 sec = find_type_for_map(btf, map_ident); in codegen_subskel_datasecs()
320 sec_name = btf__name_by_offset(btf, sec->name_off); in codegen_subskel_datasecs()
337 var = btf__type_by_id(btf, sec_var->type); in codegen_subskel_datasecs()
338 var_name = btf__name_by_offset(btf, var->name_off); in codegen_subskel_datasecs()
348 var = skip_mods_and_typedefs(btf, var->type, NULL); in codegen_subskel_datasecs()
357 needs_typeof = btf_is_array(var) || btf_is_ptr_to_func_proto(btf, var); in codegen_subskel_datasecs()
469 struct btf *btf = bpf_object__btf(obj); in codegen_asserts() local
476 if (!btf) in codegen_asserts()
493 sec = find_type_for_map(btf, map_ident); in codegen_asserts()
503 const struct btf_type *var = btf__type_by_id(btf, sec_var->type); in codegen_asserts()
504 const char *var_name = btf__name_by_offset(btf, var->name_off); in codegen_asserts()
511 var_size = btf__resolve_size(btf, var->type); in codegen_asserts()
918 struct btf *btf; in do_skeleton() local
1072 btf = bpf_object__btf(obj); in do_skeleton()
1073 if (btf) { in do_skeleton()
1287 struct btf *btf; in do_subskeleton() local
1364 btf = bpf_object__btf(obj); in do_subskeleton()
1365 if (!btf) { in do_subskeleton()
1394 map_type = btf__type_by_id(btf, map_type_id); in do_subskeleton()
1399 var_type = btf__type_by_id(btf, var->type); in do_subskeleton()
1512 map_type = btf__type_by_id(btf, map_type_id); in do_subskeleton()
1516 var_type = btf__type_by_id(btf, var->type); in do_subskeleton()
1517 var_name = btf__name_by_offset(btf, var_type->name_off); in do_subskeleton()
1634 static int btf_save_raw(const struct btf *btf, const char *path) in btf_save_raw() argument
1641 data = btf__raw_data(btf, &data_sz); in btf_save_raw()
1657 struct btf *src_btf;
1658 struct btf *marked_btf; /* btf structure used to mark used types */
1801 struct btf *btf = info->src_btf; in btfgen_record_field_relo() local
1809 btf_type = btf__type_by_id(btf, type_id); in btfgen_record_field_relo()
1819 btf_type = btf__type_by_id(btf, type_id); in btfgen_record_field_relo()
1833 btf_type = btf__type_by_id(btf, type_id); in btfgen_record_field_relo()
1841 btf_type = btf__type_by_id(btf, type_id); in btfgen_record_field_relo()
1864 struct btf *btf = info->src_btf; in btfgen_mark_type_match() local
1871 btf_type = btf__type_by_id(btf, type_id); in btfgen_mark_type_match()
1996 btfgen_find_cands(const struct btf *local_btf, const struct btf *targ_btf, __u32 local_id) in btfgen_find_cands()
2005 local_cand.btf = local_btf; in btfgen_find_cands()
2047 struct btf *btf = NULL; in btfgen_record_obj() local
2051 btf = btf__parse(obj_path, &btf_ext); in btfgen_record_obj()
2052 if (!btf) { in btfgen_record_obj()
2082 const char *sec_name = btf__name_by_offset(btf, sec->sec_name_off); in btfgen_record_obj()
2086 cands = btfgen_find_cands(btf, info->src_btf, relo->type_id); in btfgen_record_obj()
2098 err = bpf_core_calc_relo_insn(sec_name, relo, relo_idx, btf, cands, in btfgen_record_obj()
2111 btf__free(btf); in btfgen_record_obj()
2134 static struct btf *btfgen_get_btf(struct btfgen_info *info) in btfgen_get_btf()
2136 struct btf *btf_new = NULL; in btfgen_get_btf()
2254 struct btf *btf_new = NULL; in minimize_btf()