staticint dissect_jited_func(struct bpf_prog_linfo *prog_linfo, const __u64 *ksym_func, const __u32 *ksym_len)
{
__u32 nr_jited_func, nr_linfo; constvoid *raw_jited_linfo; const __u64 *jited_linfo;
__u64 last_jited_linfo; /* * Index to raw_jited_linfo: * i: Index for searching the next ksym_func * prev_i: Index to the last found ksym_func
*/
__u32 i, prev_i;
__u32 f; /* Index to ksym_func */
prog_linfo->nr_jited_linfo_per_func[f - 1] =
i - prev_i;
prev_i = i;
/* * The ksym_func[f] is found in jited_linfo. * Look for the next one.
*/
f++;
} elseif (*jited_linfo <= last_jited_linfo) { /* Ensure the addr is increasing _within_ a func */ goto errout;
}
}
/* * The min size that bpf_prog_linfo has to access for * searching purpose.
*/ if (info->line_info_rec_size <
offsetof(struct bpf_line_info, file_name_off)) return errno = EINVAL, NULL;
/* Number of jited_line_info per jited func */
prog_linfo->nr_jited_linfo_per_func = malloc(nr_jited_func * sizeof(__u32)); if (!prog_linfo->nr_jited_linfo_per_func) goto err_free;
/* * For each jited func, * the start idx to the "linfo" and "jited_linfo" array,
*/
prog_linfo->jited_linfo_func_idx = malloc(nr_jited_func * sizeof(__u32)); if (!prog_linfo->jited_linfo_func_idx) goto err_free;
if (dissect_jited_func(prog_linfo,
(__u64 *)(long)info->jited_ksyms,
(__u32 *)(long)info->jited_func_lens)) goto err_free;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.