Skip to content

Commit

Permalink
perf report: Handle vDSO symbols properly
Browse files Browse the repository at this point in the history
We were not looking up vDSO symbols properly, because they
are in the kallsyms but are user-mode entries.

Pass negative addresses to the kernel dso object, this
way we resolve them properly:

     0.05%  [kernel]: vread_tsc

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Jun 3, 2009
1 parent 5352f35 commit ed966aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@ static int __cmd_report(void)
event->ip.pid,
(void *)(long)ip);

dprintf(" ... thread: %s:%d\n", thread->comm, thread->pid);

if (thread == NULL) {
fprintf(stderr, "problem processing %d event, skipping it.\n",
event->header.type);
Expand All @@ -740,6 +742,8 @@ static int __cmd_report(void)

dso = kernel_dso;

dprintf(" ...... dso: %s\n", dso->name);

} else if (event->header.misc & PERF_EVENT_MISC_USER) {

show = SHOW_USER;
Expand All @@ -749,11 +753,22 @@ static int __cmd_report(void)
if (map != NULL) {
dso = map->dso;
ip -= map->start + map->pgoff;
} else {
/*
* If this is outside of all known maps,
* and is a negative address, try to look it
* up in the kernel dso, as it might be a
* vsyscall (which executes in user-mode):
*/
if ((long long)ip < 0)
dso = kernel_dso;
}
dprintf(" ...... dso: %s\n", dso ? dso->name : "<not found>");

} else {
show = SHOW_HV;
level = 'H';
dprintf(" ...... dso: [hypervisor]\n");
}

if (show & show_mask) {
Expand Down

0 comments on commit ed966aa

Please sign in to comment.