From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH V4 13/13] perf tools: add annotation call target name if it is missing
Date: Wed, 7 Aug 2013 14:38:57 +0300 [thread overview]
Message-ID: <1375875537-4509-14-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1375875537-4509-1-git-send-email-adrian.hunter@intel.com>
kcore 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.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/annotate.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 646e38d..bfc5a27 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,
dl->ops.target.offset = dl->ops.target.addr -
map__rip_2objdump(map, sym->start);
+ /*
+ * kcore has no symbols, so add the call target name if it is on the
+ * same map.
+ */
+ if (dl->ins && ins__is_call(dl->ins) && !dl->ops.target.name) {
+ struct symbol *s;
+ u64 ip = dl->ops.target.addr;
+
+ if (ip >= map->start && ip <= map->end) {
+ ip = map->map_ip(map, ip);
+ s = map__find_symbol(map, ip, NULL);
+ if (s && s->start == ip)
+ dl->ops.target.name = strdup(s->name);
+ }
+ }
+
disasm__add(¬es->src->source, dl);
return 0;
--
1.7.11.7
next prev parent reply other threads:[~2013-08-07 11:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 11:38 [PATCH V4 00/13] perf tools: add support for reading object code Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 01/13] perf tools: add test " Adrian Hunter
2013-08-12 10:20 ` [tip:perf/core] perf tests: Add " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 02/13] perf tools: load kernel maps before using Adrian Hunter
2013-08-12 10:20 ` [tip:perf/core] perf symbols: Load " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 03/13] perf tools: make it possible to read object code from vmlinux Adrian Hunter
2013-08-12 10:21 ` [tip:perf/core] perf tools: Make " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 04/13] perf tools: adjust the vmlinux symtab matches kallsyms test Adrian Hunter
2013-08-12 10:21 ` [tip:perf/core] perf tests: Adjust " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 05/13] perf tools: avoid SyS kernel syscall aliases Adrian Hunter
2013-08-12 10:20 ` [tip:perf/core] perf symbols: " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 06/13] perf tools: make it possible to read object code from kernel modules Adrian Hunter
2013-08-12 10:21 ` [tip:perf/core] perf tools: Make " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 07/13] perf tools: add support for reading from /proc/kcore Adrian Hunter
2013-08-12 10:21 ` [tip:perf/core] perf symbols: Add support for reading from /proc/ kcore tip-bot for Adrian Hunter
2013-09-12 13:13 ` Ingo Molnar
2013-09-12 13:16 ` [PATCH] Fix old GCC build error in perf/util/trace-event-parse.c:parse_proc_kallsyms() Ingo Molnar
2013-09-20 9:56 ` [tip:perf/urgent] perf tools: Fix old GCC build error in trace-event-parse.c:parse_proc_kallsyms() tip-bot for Ingo Molnar
2013-08-07 11:38 ` [PATCH V4 08/13] perf tools: adjust the vmlinux symtab matches kallsyms test again Adrian Hunter
2013-08-12 10:21 ` [tip:perf/core] perf tests: Adjust " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 09/13] perf tools: add kcore to the object code reading test Adrian Hunter
2013-08-12 10:21 ` [tip:perf/core] perf tests: Add " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 10/13] perf tools: allow annotation using /proc/kcore Adrian Hunter
2013-08-12 10:22 ` [tip:perf/core] perf annotate: Allow disassembly using /proc/ kcore tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 11/13] perf tools: put dso name in symbol annotation title Adrian Hunter
2013-08-12 10:22 ` [tip:perf/core] perf annotate: Put " tip-bot for Adrian Hunter
2013-08-07 11:38 ` [PATCH V4 12/13] perf tools: remove nop at end of annotation Adrian Hunter
2013-08-12 10:22 ` [tip:perf/core] perf annotate: Remove " tip-bot for Adrian Hunter
2013-08-07 11:38 ` Adrian Hunter [this message]
2013-08-12 10:22 ` [tip:perf/core] perf annotate: Add call target name if it is missing tip-bot for Adrian Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375875537-4509-14-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).