Lines Matching refs:btf
252 static int find_field_offset_aux(struct btf *btf, int btf_id, char *field_name, int off) in find_field_offset_aux() argument
254 const struct btf_type *type = btf__type_by_id(btf, btf_id); in find_field_offset_aux()
273 const char *mname = btf__name_by_offset(btf, m->name_off); in find_field_offset_aux()
276 int msize = find_field_offset_aux(btf, m->type, field_name, in find_field_offset_aux()
291 static int find_field_offset(struct btf *btf, char *pattern, regmatch_t *matches) in find_field_offset() argument
313 btf_id = btf__find_by_name(btf, type_str); in find_field_offset()
319 field_offset = find_field_offset_aux(btf, btf_id, field_str, 0); in find_field_offset()
490 static bool match_pattern(struct btf *btf, char *pattern, char *text, char *reg_map[][2]) in match_pattern() argument
561 field_offset = find_field_offset(btf, pattern, matches); in match_pattern()
587 field_offset = find_field_offset(btf, pattern, matches); in match_pattern()
640 static void match_program(struct btf *btf, in match_program() argument
695 ASSERT_TRUE(match_pattern(btf, pattern, text, reg_map), in match_program()
705 static void run_one_testcase(struct btf *btf, struct test_case *test) in run_one_testcase() argument
749 match_program(btf, &pinfo, test->read, reg_map, false); in run_one_testcase()
782 match_program(btf, &pinfo, pattern, stx_reg_map, true); in run_one_testcase()
791 match_program(btf, &pinfo, pattern, st_reg_map, false); in run_one_testcase()
800 struct btf *btf; in test_ctx_rewrite() local
808 btf = btf__load_vmlinux_btf(); in test_ctx_rewrite()
809 if (!btf) { in test_ctx_rewrite()
815 run_one_testcase(btf, &test_cases[i]); in test_ctx_rewrite()
818 btf__free(btf); in test_ctx_rewrite()