diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-08-07 07:38:57 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-08-07 16:35:36 -0400 |
commit | b178170a38e719cb7bc4a14d3f5e4b4ea6b7b851 (patch) | |
tree | 2eda9b492257ccebee417a4d2fac379d3c3bd8ec /tools | |
parent | 484a5e7476b7ce790ba37417a4976c7f86a87231 (diff) |
perf annotate: Add call target name if it is missing
The /proc/kcore file has no symbols, so the call target name does not
display. Fix by looking up the symbol name if it is on the same map.
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1375875537-4509-14-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/annotate.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 646e38dad01b..bfc5a27597d6 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -825,6 +825,22 @@ static int symbol__parse_objdump_line(struct symbol *sym, struct map *map, | |||
825 | dl->ops.target.offset = dl->ops.target.addr - | 825 | dl->ops.target.offset = dl->ops.target.addr - |
826 | map__rip_2objdump(map, sym->start); | 826 | map__rip_2objdump(map, sym->start); |
827 | 827 | ||
828 | /* | ||
829 | * kcore has no symbols, so add the call target name if it is on the | ||
830 | * same map. | ||
831 | */ | ||
832 | if (dl->ins && ins__is_call(dl->ins) && !dl->ops.target.name) { | ||
833 | struct symbol *s; | ||
834 | u64 ip = dl->ops.target.addr; | ||
835 | |||
836 | if (ip >= map->start && ip <= map->end) { | ||
837 | ip = map->map_ip(map, ip); | ||
838 | s = map__find_symbol(map, ip, NULL); | ||
839 | if (s && s->start == ip) | ||
840 | dl->ops.target.name = strdup(s->name); | ||
841 | } | ||
842 | } | ||
843 | |||
828 | disasm__add(¬es->src->source, dl); | 844 | disasm__add(¬es->src->source, dl); |
829 | 845 | ||
830 | return 0; | 846 | return 0; |