aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c
diff options
context:
space:
mode:
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>2016-06-24 07:53:58 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-06-27 13:25:05 -0400
commit6ef9492915b09816c75bb41e7e37b2e507d2f70f (patch)
tree7dc66188a6168c9bcd799febdbe6ea9d7f923ba5 /tools/perf/ui/browsers/annotate.c
parent9f776ba11c8be311a5c23777bc9f3b96498cc6cc (diff)
perf annotate: Generalize handling of 'ret' instructions
Introduce helper to detect 'ret' instructions and use the same in the TUI. A helper is needed since some architectures such as powerpc have more than one return instruction. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Anton Blanchard <anton@ozlabs.org> Cc: Daniel Axtens <dja@axtens.net> Cc: Michael Ellerman <mpe@ellerman.id.au> Link: http://lkml.kernel.org/r/1466769240-12376-5-git-send-email-ravi.bangoria@linux.vnet.ibm.com 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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 0e106bb97525..29dc6d20364e 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -223,16 +223,14 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
223 } else if (ins__is_call(dl->ins)) { 223 } else if (ins__is_call(dl->ins)) {
224 ui_browser__write_graph(browser, SLSMG_RARROW_CHAR); 224 ui_browser__write_graph(browser, SLSMG_RARROW_CHAR);
225 SLsmg_write_char(' '); 225 SLsmg_write_char(' ');
226 } else if (ins__is_ret(dl->ins)) {
227 ui_browser__write_graph(browser, SLSMG_LARROW_CHAR);
228 SLsmg_write_char(' ');
226 } else { 229 } else {
227 ui_browser__write_nstring(browser, " ", 2); 230 ui_browser__write_nstring(browser, " ", 2);
228 } 231 }
229 } else { 232 } else {
230 if (strcmp(dl->name, "retq")) { 233 ui_browser__write_nstring(browser, " ", 2);
231 ui_browser__write_nstring(browser, " ", 2);
232 } else {
233 ui_browser__write_graph(browser, SLSMG_LARROW_CHAR);
234 SLsmg_write_char(' ');
235 }
236 } 234 }
237 235
238 disasm_line__scnprintf(dl, bf, sizeof(bf), !annotate_browser__opts.use_offset); 236 disasm_line__scnprintf(dl, bf, sizeof(bf), !annotate_browser__opts.use_offset);
@@ -843,14 +841,14 @@ show_help:
843 ui_helpline__puts("Huh? No selection. Report to linux-kernel@vger.kernel.org"); 841 ui_helpline__puts("Huh? No selection. Report to linux-kernel@vger.kernel.org");
844 else if (browser->selection->offset == -1) 842 else if (browser->selection->offset == -1)
845 ui_helpline__puts("Actions are only available for assembly lines."); 843 ui_helpline__puts("Actions are only available for assembly lines.");
846 else if (!browser->selection->ins) { 844 else if (!browser->selection->ins)
847 if (strcmp(browser->selection->name, "retq")) 845 goto show_sup_ins;
848 goto show_sup_ins; 846 else if (ins__is_ret(browser->selection->ins))
849 goto out; 847 goto out;
850 } else if (!(annotate_browser__jump(browser) || 848 else if (!(annotate_browser__jump(browser) ||
851 annotate_browser__callq(browser, evsel, hbt))) { 849 annotate_browser__callq(browser, evsel, hbt))) {
852show_sup_ins: 850show_sup_ins:
853 ui_helpline__puts("Actions are only available for 'callq', 'retq' & jump instructions."); 851 ui_helpline__puts("Actions are only available for function call/return & jump/branch instructions.");
854 } 852 }
855 continue; 853 continue;
856 case 't': 854 case 't':