diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-19 10:16:27 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-19 10:16:27 -0300 |
commit | 28548d78ad521310f0ae58f791aa796d3d685151 (patch) | |
tree | 381d507e987faec4e1628fecf588c85987adaa35 /tools/perf/ui | |
parent | d86b0597c4bd41ea3edc6446a855306eed34f93b (diff) | |
download | blackbird-op-linux-28548d78ad521310f0ae58f791aa796d3d685151.tar.gz blackbird-op-linux-28548d78ad521310f0ae58f791aa796d3d685151.zip |
perf annotate: Introduce scnprintf ins_ops method
And implement the jump one, where if the operands string is not passed,
a compact form that uses just the target address is used.
Right now this is toggled via the 'o' option in the annotate browser,
switching from:
0.00 : ffffffff811661e8: je ffffffff81166204 <mem_cgroup_count_vm_event+0x44>
0.00 : ffffffff811661ea: cmp $0xb,%esi
0.00 : ffffffff811661ed: je ffffffff811661f8 <mem_cgroup_count_vm_event+0x38>
To:
0.00 : 28: je 44
0.00 : 2a: cmp $0xb,%esi
0.00 : 2d: je 38
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.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/n/tip-o88q46yh4kxgpd1chk5gvjl5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 46ef966ccc5b..f7d2db3e8464 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -83,7 +83,7 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro else if (dl->offset == -1) slsmg_write_nstring(dl->line, width - 18); else { - char bf[64]; + char bf[256], *line = dl->line; u64 addr = dl->offset; int printed, color = -1; @@ -96,7 +96,16 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro slsmg_write_nstring(bf, printed); if (change_color) ui_browser__set_color(self, color); - slsmg_write_nstring(dl->line, width - 18 - printed); + if (dl->ins && dl->ins->ops->scnprintf) { + dl->ins->ops->scnprintf(dl->ins, bf, sizeof(bf), + !ab->use_offset ? dl->operands : NULL, + dl->target); + line = bf; + slsmg_write_nstring(" ", 7); + printed += 7; + } + + slsmg_write_nstring(line, width - 18 - printed); } if (current_entry) |