perf symbols: Set the DSO long name when using symbol_conf.vmlinux_name

We need to set the long name to the name specified via, for instance,
'perf annotate --vmlinux /path/to/vmlinux', if not it will remain as
'[kernel.kallsyms]' and that will make annotate fail when passing this
as the vmlinux name in the call to objdump.

The way this is setup grew unwieldly and dso__load_vmlinux is the
function that should allocate space for the long name, with callers not
assuming that filenames should be allocated somehow by then (strdup,
dso__build_id_filename, etc).

For now this is the minimalistic patch, a proper fix for .36 will be
Reported-by: default avatarStephane Eranian <>
Tested-by: default avatarStephane Eranian <>
Cc: David S. Miller <>
Cc: Frédéric Weisbecker <>
Cc: Ingo Molnar <>
Cc: Mike Galbraith <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: Stephane Eranian <>
Cc: Tom Zanussi <>
LKML-Reference: <>
Signed-off-by: default avatarArnaldo Carvalho de Melo <>
parent da3fd1a0
......@@ -1745,7 +1745,12 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
if (symbol_conf.vmlinux_name != NULL) {
err = dso__load_vmlinux(self, map,
symbol_conf.vmlinux_name, filter);
goto out_try_fixup;
if (err > 0) {
goto out_fixup;
return err;
if (vmlinux_path != NULL) {
......@@ -1806,7 +1811,6 @@ do_kallsyms:
pr_debug("Using %s for symbols\n", kallsyms_filename);
if (err > 0) {
if (kallsyms_filename != NULL)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment