static struct debuginfo *__debuginfo__new(const char *path) { struct debuginfo *dbg = zalloc(sizeof(*dbg)); if (!dbg) return NULL; if (debuginfo__init_offline_dwarf(dbg, path) < 0) zfree(&dbg); if (dbg) pr_debug("Open Debuginfo file: %s\n", path); return dbg; }
struct debuginfo *debuginfo__new(const char *path) { struct debuginfo *self = zalloc(sizeof(struct debuginfo)); if (!self) return NULL; if (debuginfo__init_offline_dwarf(self, path) < 0) { free(self); self = NULL; } return self; }
static int debuginfo__init_online_kernel_dwarf(struct debuginfo *self, Dwarf_Addr addr __used) { const char *path = kernel_get_module_path("kernel"); if (!path) { pr_err("Failed to find vmlinux path\n"); return -ENOENT; } pr_debug2("Use file %s for debuginfo\n", path); return debuginfo__init_offline_dwarf(self, path); }