staticconst Dwfl_Callbacks offline_callbacks = {
.find_debuginfo = __find_debuginfo,
.debuginfo_path = &debuginfo_path,
.section_address = dwfl_offline_section_address, // .find_elf is not set as we use dwfl_report_elf() instead.
};
staticint __report_module(struct addr_location *al, u64 ip, struct unwind_info *ui)
{
Dwfl_Module *mod; struct dso *dso = NULL;
Dwarf_Addr base; /* * Some callers will use al->sym, so we can't just use the * cheaper thread__find_map() here.
*/
thread__find_symbol(ui->thread, PERF_RECORD_MISC_USER, ip, al);
if (al->map)
dso = map__dso(al->map);
if (!dso) return 0;
/* * The generated JIT DSO files only map the code segment without * ELF headers. Since JIT codes used to be packed in a memory * segment, calculating the base address using pgoff falls into * a different code in another DSO. So just use the map->start * directly to pick the correct one.
*/ if (!strncmp(dso__long_name(dso), "/tmp/jitted-", 12))
base = map__start(al->map); else
base = map__start(al->map) - map__pgoff(al->map);
mod = dwfl_addrmodule(ui->dwfl, ip); if (mod) {
Dwarf_Addr s;
dwfl_module_info(mod, NULL, &s, NULL, NULL, NULL, NULL, NULL); if (s != base)
mod = NULL;
}
if (!mod) { char filename[PATH_MAX];
__symbol__join_symfs(filename, sizeof(filename), dso__long_name(dso)); /* Don't hang up on device files like /dev/dri/renderD128. */ if (is_regular_file(filename)) {
mod = dwfl_report_elf(ui->dwfl, dso__short_name(dso), filename, -1,
base, false);
}
} if (!mod) { char filename[PATH_MAX];
if (dso__build_id_filename(dso, filename, sizeof(filename), false))
mod = dwfl_report_elf(ui->dwfl, dso__short_name(dso), filename, -1,
base, false);
}
static pid_t next_thread(Dwfl *dwfl, void *arg, void **thread_argp)
{ /* We want only single thread to be processed. */ if (*thread_argp != NULL) return 0;
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.