Lines Matching refs:btf
249 static int find_field_offset_aux(struct btf *btf, int btf_id, char *field_name, int off) in find_field_offset_aux() argument
251 const struct btf_type *type = btf__type_by_id(btf, btf_id); in find_field_offset_aux()
270 const char *mname = btf__name_by_offset(btf, m->name_off); in find_field_offset_aux()
273 int msize = find_field_offset_aux(btf, m->type, field_name, in find_field_offset_aux()
288 static int find_field_offset(struct btf *btf, char *pattern, regmatch_t *matches) in find_field_offset() argument
310 btf_id = btf__find_by_name(btf, type_str); in find_field_offset()
316 field_offset = find_field_offset_aux(btf, btf_id, field_str, 0); in find_field_offset()
487 static bool match_pattern(struct btf *btf, char *pattern, char *text, char *reg_map[][2]) in match_pattern() argument
558 field_offset = find_field_offset(btf, pattern, matches); in match_pattern()
584 field_offset = find_field_offset(btf, pattern, matches); in match_pattern()
738 static void match_program(struct btf *btf, in match_program() argument
791 ASSERT_TRUE(match_pattern(btf, pattern, text, reg_map), in match_program()
801 static void run_one_testcase(struct btf *btf, struct test_case *test) in run_one_testcase() argument
845 match_program(btf, &pinfo, test->read, reg_map, false); in run_one_testcase()
878 match_program(btf, &pinfo, pattern, stx_reg_map, true); in run_one_testcase()
887 match_program(btf, &pinfo, pattern, st_reg_map, false); in run_one_testcase()
896 struct btf *btf; in test_ctx_rewrite() local
904 btf = btf__load_vmlinux_btf(); in test_ctx_rewrite()
905 if (!btf) { in test_ctx_rewrite()
911 run_one_testcase(btf, &test_cases[i]); in test_ctx_rewrite()
914 btf__free(btf); in test_ctx_rewrite()