Lines Matching defs:btf
6 #include <linux/btf.h>
22 skip_mods_and_typedefs(const struct btf *btf, u32 id, u32 *res_id)
24 return btf_type_skip_modifiers(btf, id, res_id);
27 static const char *btf__name_by_offset(const struct btf *btf, u32 offset)
29 return btf_name_by_offset(btf, offset);
32 static s64 btf__resolve_size(const struct btf *btf, u32 type_id)
37 t = btf_type_by_id(btf, type_id);
38 t = btf_resolve_size(btf, t, &size);
66 #include "btf.h"
71 static bool is_flex_arr(const struct btf *btf,
82 t = btf_type_by_id(btf, acc->type_id);
146 int __bpf_core_types_are_compat(const struct btf *local_btf, __u32 local_id,
147 const struct btf *targ_btf, __u32 targ_id, int level)
263 int bpf_core_parse_spec(const char *prog_name, const struct btf *btf,
274 spec_str = btf__name_by_offset(btf, relo->access_str_off);
279 spec->btf = btf;
305 t = skip_mods_and_typedefs(btf, relo->type_id, &id);
322 acc->name = btf__name_by_offset(btf, name_off);
329 sz = btf__resolve_size(btf, id);
335 t = skip_mods_and_typedefs(btf, id, &id);
354 name = btf__name_by_offset(btf, m->name_off);
369 t = skip_mods_and_typedefs(btf, a->type, &id);
373 flex = is_flex_arr(btf, acc - 1, a);
381 sz = btf__resolve_size(btf, id);
412 static int bpf_core_fields_are_compat(const struct btf *local_btf,
414 const struct btf *targ_btf,
481 static int bpf_core_match_member(const struct btf *local_btf,
483 const struct btf *targ_btf,
558 const struct btf *targ_btf, __u32 targ_id,
568 targ_spec->btf = targ_btf;
574 return bpf_core_types_match(local_spec->btf,
578 return bpf_core_types_are_compat(local_spec->btf,
591 targ_type = skip_mods_and_typedefs(targ_spec->btf, targ_id, &targ_id);
603 targ_name = btf__name_by_offset(targ_spec->btf, name_off);
624 targ_type = skip_mods_and_typedefs(targ_spec->btf, targ_id,
630 matched = bpf_core_match_member(local_spec->btf,
703 t = btf_type_by_id(spec->btf, acc->type_id);
710 sz = btf__resolve_size(spec->btf, acc->type_id);
716 sz = btf__resolve_size(spec->btf, acc->type_id);
731 mt = skip_mods_and_typedefs(spec->btf, m->type, &field_type_id);
751 sz = btf__resolve_size(spec->btf, field_type_id);
833 sz = btf__resolve_size(spec->btf, spec->root_type_id);
860 t = btf_type_by_id(spec->btf, spec->spec[0].type_id);
913 orig_t = btf_type_by_id(local_spec->btf, res->orig_type_id);
914 new_t = btf_type_by_id(targ_spec->btf, res->new_type_id);
1175 t = btf_type_by_id(spec->btf, type_id);
1176 s = btf__name_by_offset(spec->btf, t->name_off);
1186 t = skip_mods_and_typedefs(spec->btf, type_id, NULL);
1192 s = btf__name_by_offset(spec->btf, e->name_off);
1200 s = btf__name_by_offset(spec->btf, e->name_off);
1283 const struct btf *local_btf,
1338 err = bpf_core_spec_match(local_spec, cands->cands[i].btf,
1422 static bool bpf_core_names_match(const struct btf *local_btf, size_t local_name_off,
1423 const struct btf *targ_btf, size_t targ_name_off)
1440 static int bpf_core_enums_match(const struct btf *local_btf, const struct btf_type *local_t,
1441 const struct btf *targ_btf, const struct btf_type *targ_t)
1479 static int bpf_core_composites_match(const struct btf *local_btf, const struct btf_type *local_t,
1480 const struct btf *targ_btf, const struct btf_type *targ_t,
1544 int __bpf_core_types_match(const struct btf *local_btf, __u32 local_id, const struct btf *targ_btf,