lkml.org 
[lkml]   [2010]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: how to use perf annotate on the kernel
Em Thu, Jun 03, 2010 at 07:23:02PM +0200, Stephane Eranian escreveu:
> Arnaldo,
>
> I am trying to understand how one is supposed
> to use perf annotate to get sample correlations
> with kernel symbols.
>
> I do:
>
> # perf record -a -e cycles:k dd if=/dev/zero of=/dev/null count=1000000
> # perf report
>
> # Events: 14K cycles
> #
> # Overhead Command Shared Object Symbol
> # ........ ............... ................... ......
> #
> 8.76% dd [kernel.kallsyms] [k] __lock_acquire
> 7.49% dd [kernel.kallsyms] [k] sched_clock
>
> # perf annotate (or annotate -d '[kernel.kallsyms]'?)
> Can't annotate __lock_acquire: No vmlinux file was found in the path
>
> # perf annotate -k vmlinux
> objdump: '[kernel.kallsyms]': No such file

This looks like a bug in how it reports this problem, probably vmlinux
is not in the current directory, or it is but has a build-id that
doesn't matches the one in the perf.data file.

But the message is wrong, should be like it is in the tui, for this same
situation:

ui_helpline__puts("No vmlinux file found, can't "
"annotate with just a kallsyms file");

> Am I missing something here?

If you don't specify it with --vmlinux/-k it will try to find it in one
of these places:

vmlinux_path[vmlinux_path__nr_entries] = strdup("vmlinux");
if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
goto out_fail;
++vmlinux_path__nr_entries;
vmlinux_path[vmlinux_path__nr_entries] = strdup("/boot/vmlinux");
if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
goto out_fail;
++vmlinux_path__nr_entries;
snprintf(bf, sizeof(bf), "/boot/vmlinux-%s", uts.release);
vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
goto out_fail;
++vmlinux_path__nr_entries;
snprintf(bf, sizeof(bf), "/lib/modules/%s/build/vmlinux", uts.release);
vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
goto out_fail;
++vmlinux_path__nr_entries;
snprintf(bf, sizeof(bf), "/usr/lib/debug/lib/modules/%s/vmlinux",
uts.release);
vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);

It also now looks at /sys/kernel/notes, gets the build-id, and looks up
in the build-id cache.

- Arnaldo


\
 
 \ /
  Last update: 2010-06-03 19:57    [W:0.195 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site