summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorAkihiro Nagai <akihiro.nagai.hw@hitachi.com>2012-01-30 13:43:15 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-01-30 18:09:21 -0200
commita978f2ab4166a84c77d0f846f59690f2a892d058 (patch)
tree015a35d71132a28a53b729be99ab469ebb641a66 /tools/perf/util/session.c
parent9558259697b827106b464648e850e568e0b0c931 (diff)
downloadlinux-a978f2ab4166a84c77d0f846f59690f2a892d058.tar.bz2
perf script: Add the offset field specifier
Add the offset field specifier 'symoff' to show the offset from the symbols in the output of perf-script. We can get the more detailed address information. Output sample: ffffffff81467612 irq_return+0x0 => 301ec016b0 _start+0x0 ffffffff81467612 irq_return+0x0 => 301ec016b0 _start+0x0 301ec016b3 _start+0x3 => 301ec04b70 _dl_start+0x0 ffffffff81467612 irq_return+0x0 => 301ec04b70 _dl_start+0x0 ffffffff81467612 irq_return+0x0 => 301ec04b96 _dl_start+0x26 ffffffff81467612 irq_return+0x0 => 301ec04b9d _dl_start+0x2d 301ec04beb _dl_start+0x7b => 301ec04c0d _dl_start+0x9d 301ec04c11 _dl_start+0xa1 => 301ec04bf0 _dl_start+0x80 [snip] Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: yrl.pp-manager.tt@hitachi.com Link: http://lkml.kernel.org/r/20120130044314.2384.67094.stgit@linux3 Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e5334a976536..552c1c50eea1 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1293,7 +1293,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
struct machine *machine, struct perf_evsel *evsel,
- int print_sym, int print_dso)
+ int print_sym, int print_dso, int print_symoffset)
{
struct addr_location al;
struct callchain_cursor *cursor = &evsel->hists.callchain_cursor;
@@ -1340,7 +1340,11 @@ void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
printf("%16" PRIx64, sample->ip);
if (print_sym) {
printf(" ");
- symbol__fprintf_symname(al.sym, stdout);
+ if (print_symoffset)
+ symbol__fprintf_symname_offs(al.sym, &al,
+ stdout);
+ else
+ symbol__fprintf_symname(al.sym, stdout);
}
if (print_dso) {