Lines Matching refs:main_prog

6196 			      struct bpf_program *main_prog,  in reloc_prog_func_and_line_info()  argument
6210 if (main_prog != prog && !main_prog->func_info) in reloc_prog_func_and_line_info()
6214 &main_prog->func_info, in reloc_prog_func_and_line_info()
6215 &main_prog->func_info_cnt, in reloc_prog_func_and_line_info()
6216 &main_prog->func_info_rec_size); in reloc_prog_func_and_line_info()
6223 if (main_prog->func_info) { in reloc_prog_func_and_line_info()
6238 if (main_prog != prog && !main_prog->line_info) in reloc_prog_func_and_line_info()
6242 &main_prog->line_info, in reloc_prog_func_and_line_info()
6243 &main_prog->line_info_cnt, in reloc_prog_func_and_line_info()
6244 &main_prog->line_info_rec_size); in reloc_prog_func_and_line_info()
6251 if (main_prog->line_info) { in reloc_prog_func_and_line_info()
6284 static int append_subprog_relos(struct bpf_program *main_prog, struct bpf_program *subprog) in append_subprog_relos() argument
6286 int new_cnt = main_prog->nr_reloc + subprog->nr_reloc; in append_subprog_relos()
6290 if (main_prog == subprog) in append_subprog_relos()
6292 relos = libbpf_reallocarray(main_prog->reloc_desc, new_cnt, sizeof(*relos)); in append_subprog_relos()
6300 memcpy(relos + main_prog->nr_reloc, subprog->reloc_desc, in append_subprog_relos()
6303 for (i = main_prog->nr_reloc; i < new_cnt; i++) in append_subprog_relos()
6308 main_prog->reloc_desc = relos; in append_subprog_relos()
6309 main_prog->nr_reloc = new_cnt; in append_subprog_relos()
6314 bpf_object__append_subprog_code(struct bpf_object *obj, struct bpf_program *main_prog, in bpf_object__append_subprog_code() argument
6321 subprog->sub_insn_off = main_prog->insns_cnt; in bpf_object__append_subprog_code()
6323 new_cnt = main_prog->insns_cnt + subprog->insns_cnt; in bpf_object__append_subprog_code()
6324 insns = libbpf_reallocarray(main_prog->insns, new_cnt, sizeof(*insns)); in bpf_object__append_subprog_code()
6326 pr_warn("prog '%s': failed to realloc prog code\n", main_prog->name); in bpf_object__append_subprog_code()
6329 main_prog->insns = insns; in bpf_object__append_subprog_code()
6330 main_prog->insns_cnt = new_cnt; in bpf_object__append_subprog_code()
6332 memcpy(main_prog->insns + subprog->sub_insn_off, subprog->insns, in bpf_object__append_subprog_code()
6336 main_prog->name, subprog->insns_cnt, subprog->name); in bpf_object__append_subprog_code()
6339 err = append_subprog_relos(main_prog, subprog); in bpf_object__append_subprog_code()
6346 bpf_object__reloc_code(struct bpf_object *obj, struct bpf_program *main_prog, in bpf_object__reloc_code() argument
6355 err = reloc_prog_func_and_line_info(obj, main_prog, prog); in bpf_object__reloc_code()
6360 insn = &main_prog->insns[prog->sub_insn_off + insn_idx]; in bpf_object__reloc_code()
6427 err = bpf_object__append_subprog_code(obj, main_prog, subprog); in bpf_object__reloc_code()
6430 err = bpf_object__reloc_code(obj, main_prog, subprog); in bpf_object__reloc_code()
6438 insn = &main_prog->insns[prog->sub_insn_off + insn_idx]; in bpf_object__reloc_code()