mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
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 made. Reported-by: Stephane Eranian <eranian@google.com> Tested-by: Stephane Eranian <eranian@google.com> Cc: David S. Miller <davem@davemloft.net> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <20100604003900.GD10469@ghostprotocols.net> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
da3fd1a001
commit
e7dadc0089
1 changed files with 6 additions and 2 deletions
|
@ -1745,7 +1745,12 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
|
||||||
if (symbol_conf.vmlinux_name != NULL) {
|
if (symbol_conf.vmlinux_name != NULL) {
|
||||||
err = dso__load_vmlinux(self, map,
|
err = dso__load_vmlinux(self, map,
|
||||||
symbol_conf.vmlinux_name, filter);
|
symbol_conf.vmlinux_name, filter);
|
||||||
goto out_try_fixup;
|
if (err > 0) {
|
||||||
|
dso__set_long_name(self,
|
||||||
|
strdup(symbol_conf.vmlinux_name));
|
||||||
|
goto out_fixup;
|
||||||
|
}
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vmlinux_path != NULL) {
|
if (vmlinux_path != NULL) {
|
||||||
|
@ -1806,7 +1811,6 @@ do_kallsyms:
|
||||||
pr_debug("Using %s for symbols\n", kallsyms_filename);
|
pr_debug("Using %s for symbols\n", kallsyms_filename);
|
||||||
free(kallsyms_allocated_filename);
|
free(kallsyms_allocated_filename);
|
||||||
|
|
||||||
out_try_fixup:
|
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
out_fixup:
|
out_fixup:
|
||||||
if (kallsyms_filename != NULL)
|
if (kallsyms_filename != NULL)
|
||||||
|
|
Loading…
Add table
Reference in a new issue