• Home
  • Raw
  • Download

Lines Matching refs:prog_linfo

22 static int dissect_jited_func(struct bpf_prog_linfo *prog_linfo,  in dissect_jited_func()  argument
37 raw_jited_linfo = prog_linfo->raw_jited_linfo; in dissect_jited_func()
42 prog_linfo->jited_linfo_func_idx[0] = 0; in dissect_jited_func()
43 nr_jited_func = prog_linfo->nr_jited_func; in dissect_jited_func()
44 nr_linfo = prog_linfo->nr_linfo; in dissect_jited_func()
49 raw_jited_linfo += prog_linfo->jited_rec_size; in dissect_jited_func()
54 prog_linfo->jited_linfo_func_idx[f] = i; in dissect_jited_func()
61 prog_linfo->nr_jited_linfo_per_func[f - 1] = in dissect_jited_func()
79 prog_linfo->nr_jited_linfo_per_func[nr_jited_func - 1] = in dissect_jited_func()
88 void bpf_prog_linfo__free(struct bpf_prog_linfo *prog_linfo) in bpf_prog_linfo__free() argument
90 if (!prog_linfo) in bpf_prog_linfo__free()
93 free(prog_linfo->raw_linfo); in bpf_prog_linfo__free()
94 free(prog_linfo->raw_jited_linfo); in bpf_prog_linfo__free()
95 free(prog_linfo->nr_jited_linfo_per_func); in bpf_prog_linfo__free()
96 free(prog_linfo->jited_linfo_func_idx); in bpf_prog_linfo__free()
97 free(prog_linfo); in bpf_prog_linfo__free()
102 struct bpf_prog_linfo *prog_linfo; in bpf_prog_linfo__new() local
119 prog_linfo = calloc(1, sizeof(*prog_linfo)); in bpf_prog_linfo__new()
120 if (!prog_linfo) in bpf_prog_linfo__new()
124 prog_linfo->nr_linfo = nr_linfo; in bpf_prog_linfo__new()
125 prog_linfo->rec_size = info->line_info_rec_size; in bpf_prog_linfo__new()
126 data_sz = (__u64)nr_linfo * prog_linfo->rec_size; in bpf_prog_linfo__new()
127 prog_linfo->raw_linfo = malloc(data_sz); in bpf_prog_linfo__new()
128 if (!prog_linfo->raw_linfo) in bpf_prog_linfo__new()
130 memcpy(prog_linfo->raw_linfo, (void *)(long)info->line_info, data_sz); in bpf_prog_linfo__new()
141 return prog_linfo; in bpf_prog_linfo__new()
144 prog_linfo->nr_jited_func = nr_jited_func; in bpf_prog_linfo__new()
145 prog_linfo->jited_rec_size = info->jited_line_info_rec_size; in bpf_prog_linfo__new()
146 data_sz = (__u64)nr_linfo * prog_linfo->jited_rec_size; in bpf_prog_linfo__new()
147 prog_linfo->raw_jited_linfo = malloc(data_sz); in bpf_prog_linfo__new()
148 if (!prog_linfo->raw_jited_linfo) in bpf_prog_linfo__new()
150 memcpy(prog_linfo->raw_jited_linfo, in bpf_prog_linfo__new()
154 prog_linfo->nr_jited_linfo_per_func = malloc(nr_jited_func * in bpf_prog_linfo__new()
156 if (!prog_linfo->nr_jited_linfo_per_func) in bpf_prog_linfo__new()
163 prog_linfo->jited_linfo_func_idx = malloc(nr_jited_func * in bpf_prog_linfo__new()
165 if (!prog_linfo->jited_linfo_func_idx) in bpf_prog_linfo__new()
168 if (dissect_jited_func(prog_linfo, in bpf_prog_linfo__new()
173 return prog_linfo; in bpf_prog_linfo__new()
176 bpf_prog_linfo__free(prog_linfo); in bpf_prog_linfo__new()
181 bpf_prog_linfo__lfind_addr_func(const struct bpf_prog_linfo *prog_linfo, in bpf_prog_linfo__lfind_addr_func() argument
188 if (func_idx >= prog_linfo->nr_jited_func) in bpf_prog_linfo__lfind_addr_func()
191 nr_linfo = prog_linfo->nr_jited_linfo_per_func[func_idx]; in bpf_prog_linfo__lfind_addr_func()
195 start = prog_linfo->jited_linfo_func_idx[func_idx] + nr_skip; in bpf_prog_linfo__lfind_addr_func()
196 jited_rec_size = prog_linfo->jited_rec_size; in bpf_prog_linfo__lfind_addr_func()
197 raw_jited_linfo = prog_linfo->raw_jited_linfo + in bpf_prog_linfo__lfind_addr_func()
204 rec_size = prog_linfo->rec_size; in bpf_prog_linfo__lfind_addr_func()
205 raw_linfo = prog_linfo->raw_linfo + (start * rec_size); in bpf_prog_linfo__lfind_addr_func()
219 bpf_prog_linfo__lfind(const struct bpf_prog_linfo *prog_linfo, in bpf_prog_linfo__lfind() argument
226 nr_linfo = prog_linfo->nr_linfo; in bpf_prog_linfo__lfind()
230 rec_size = prog_linfo->rec_size; in bpf_prog_linfo__lfind()
231 raw_linfo = prog_linfo->raw_linfo + (nr_skip * rec_size); in bpf_prog_linfo__lfind()