int symbol__disassemble(struct symbol *sym, struct map *map, size_t privsize)
{
struct dso *dso = map->dso;
- char *filename = dso__build_id_filename(dso, NULL, 0);
+ char *filename;
bool free_filename = true;
char command[PATH_MAX * 2];
FILE *file;
- int err = 0;
char symfs_filename[PATH_MAX];
struct kcore_extract kce;
bool delete_extract = false;
int lineno = 0;
int nline;
pid_t pid;
+ int err = SYMBOL_ANNOTATE_ERRNO__NO_VMLINUX;
+
+ if (dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS &&
+ !dso__is_kcore(dso))
+ goto out;
+ filename = dso__build_id_filename(dso, NULL, 0);
if (filename)
symbol__join_symfs(symfs_filename, filename);
free_filename = false;
}
- if (dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS &&
- !dso__is_kcore(dso)) {
- err = SYMBOL_ANNOTATE_ERRNO__NO_VMLINUX;
- goto out_free_filename;
- }
-
pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__,
filename, sym->name, map->unmap_ip(map, sym->start),
map->unmap_ip(map, sym->end));
kcore_extract__delete(&kce);
if (free_filename)
free(filename);
+out:
return err;
out_close_stdout: