diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-03 04:39:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-03 04:39:26 -0400 |
commit | ed966aac335a63083d3125198479447248637d9e (patch) | |
tree | 7de805123f69cd4f97bc3e91c93fca9db610eab8 | |
parent | 5352f35d6ae7b8b981d77137fb268bc54d10624f (diff) |
perf report: Handle vDSO symbols properly
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>
-rw-r--r-- | Documentation/perf_counter/builtin-report.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c index a8d390596d8d..0f88d9ebb34a 100644 --- a/Documentation/perf_counter/builtin-report.c +++ b/Documentation/perf_counter/builtin-report.c | |||
@@ -728,6 +728,8 @@ more: | |||
728 | event->ip.pid, | 728 | event->ip.pid, |
729 | (void *)(long)ip); | 729 | (void *)(long)ip); |
730 | 730 | ||
731 | dprintf(" ... thread: %s:%d\n", thread->comm, thread->pid); | ||
732 | |||
731 | if (thread == NULL) { | 733 | if (thread == NULL) { |
732 | fprintf(stderr, "problem processing %d event, skipping it.\n", | 734 | fprintf(stderr, "problem processing %d event, skipping it.\n", |
733 | event->header.type); | 735 | event->header.type); |
@@ -740,6 +742,8 @@ more: | |||
740 | 742 | ||
741 | dso = kernel_dso; | 743 | dso = kernel_dso; |
742 | 744 | ||
745 | dprintf(" ...... dso: %s\n", dso->name); | ||
746 | |||
743 | } else if (event->header.misc & PERF_EVENT_MISC_USER) { | 747 | } else if (event->header.misc & PERF_EVENT_MISC_USER) { |
744 | 748 | ||
745 | show = SHOW_USER; | 749 | show = SHOW_USER; |
@@ -749,11 +753,22 @@ more: | |||
749 | if (map != NULL) { | 753 | if (map != NULL) { |
750 | dso = map->dso; | 754 | dso = map->dso; |
751 | ip -= map->start + map->pgoff; | 755 | ip -= map->start + map->pgoff; |
756 | } else { | ||
757 | /* | ||
758 | * If this is outside of all known maps, | ||
759 | * and is a negative address, try to look it | ||
760 | * up in the kernel dso, as it might be a | ||
761 | * vsyscall (which executes in user-mode): | ||
762 | */ | ||
763 | if ((long long)ip < 0) | ||
764 | dso = kernel_dso; | ||
752 | } | 765 | } |
766 | dprintf(" ...... dso: %s\n", dso ? dso->name : "<not found>"); | ||
753 | 767 | ||
754 | } else { | 768 | } else { |
755 | show = SHOW_HV; | 769 | show = SHOW_HV; |
756 | level = 'H'; | 770 | level = 'H'; |
771 | dprintf(" ...... dso: [hypervisor]\n"); | ||
757 | } | 772 | } |
758 | 773 | ||
759 | if (show & show_mask) { | 774 | if (show & show_mask) { |