aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-04-20 13:38:46 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-20 13:38:46 -0400
commitc7e6ead7347813b5833efb9b32908c08ff131259 (patch)
tree4cd53ffe880c0cf15ee9539682623f5aed8f4378 /tools/perf/ui/browsers/annotate.c
parent3f862fd076275c442dfe295eddb5650a6e0aecd4 (diff)
perf annotate: Group operands members
So that the ins_ops can handle them in a single place, instead of adding more and more functions or ins_ops parameters. 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-pk4dqaum6ftiz104dvimwgtb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r--tools/perf/ui/browsers/annotate.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index e760326efca0..9c7b6d87822e 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -113,13 +113,12 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
113 if (change_color) 113 if (change_color)
114 ui_browser__set_color(self, color); 114 ui_browser__set_color(self, color);
115 if (dl->ins && dl->ins->ops->scnprintf) { 115 if (dl->ins && dl->ins->ops->scnprintf) {
116 dl->ins->ops->scnprintf(dl->ins, bf, sizeof(bf), 116 dl->ins->ops->scnprintf(dl->ins, bf, sizeof(bf), &dl->ops,
117 !ab->use_offset ? dl->operands : NULL, 117 !ab->use_offset);
118 dl->target);
119 slsmg_write_nstring(" ", 2); 118 slsmg_write_nstring(" ", 2);
120 printed += 2; 119 printed += 2;
121 } else 120 } else
122 scnprintf(bf, sizeof(bf), " %-6.6s %s", dl->name, dl->operands); 121 scnprintf(bf, sizeof(bf), " %-6.6s %s", dl->name, dl->ops.raw);
123 122
124 slsmg_write_nstring(bf, width - 10 - printed); 123 slsmg_write_nstring(bf, width - 10 - printed);
125 } 124 }
@@ -294,7 +293,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
294 if (!ins__is_call(dl->ins)) 293 if (!ins__is_call(dl->ins))
295 return false; 294 return false;
296 295
297 ip = ms->map->map_ip(ms->map, dl->target); 296 ip = ms->map->map_ip(ms->map, dl->ops.target);
298 target = map__find_symbol(ms->map, ip, NULL); 297 target = map__find_symbol(ms->map, ip, NULL);
299 if (target == NULL) { 298 if (target == NULL) {
300 ui_helpline__puts("The called function was not found."); 299 ui_helpline__puts("The called function was not found.");
@@ -345,7 +344,7 @@ static bool annotate_browser__jump(struct annotate_browser *browser)
345 if (!ins__is_jump(dl->ins)) 344 if (!ins__is_jump(dl->ins))
346 return false; 345 return false;
347 346
348 dl = annotate_browser__find_offset(browser, dl->target, &idx); 347 dl = annotate_browser__find_offset(browser, dl->ops.target, &idx);
349 if (dl == NULL) { 348 if (dl == NULL) {
350 ui_helpline__puts("Invallid jump offset"); 349 ui_helpline__puts("Invallid jump offset");
351 return true; 350 return true;
@@ -621,14 +620,14 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
621 if (!dl || !dl->ins || !ins__is_jump(dl->ins)) 620 if (!dl || !dl->ins || !ins__is_jump(dl->ins))
622 continue; 621 continue;
623 622
624 if (dl->target >= size) { 623 if (dl->ops.target >= size) {
625 ui__error("jump to after symbol!\n" 624 ui__error("jump to after symbol!\n"
626 "size: %zx, jump target: %" PRIx64, 625 "size: %zx, jump target: %" PRIx64,
627 size, dl->target); 626 size, dl->ops.target);
628 continue; 627 continue;
629 } 628 }
630 629
631 dlt = browser->offsets[dl->target]; 630 dlt = browser->offsets[dl->ops.target];
632 bdlt = disasm_line__browser(dlt); 631 bdlt = disasm_line__browser(dlt);
633 bdlt->jump_target = true; 632 bdlt->jump_target = true;
634 } 633 }