aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browser.c
diff options
context:
space:
mode:
authorJin Yao <yao.jin@linux.intel.com>2017-07-07 01:06:35 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-18 22:13:49 -0400
commit7e63a13a266da652f82731b845b5c35dd866ec7e (patch)
tree150f53051878fb91e9660a15d67e05d7cb6da252 /tools/perf/ui/browser.c
parent69fb09f6ccdb2f070557fd1f4c56c4d646694c8e (diff)
perf annotate: Implement visual marker for macro fusion
For marking fused instructions clearly this patch adds a line before the first instruction of pair and joins it with the arrow of the jump to its target. For example, when "je" is selected in annotate view, the line before cmpl is displayed and joins the arrow of "je". │ ┌──cmpl $0x0,argp_program_version_hook 81.93 │ ├──je 20 │ │ lock cmpxchg %esi,0x38a9a4(%rip) │ │↓ jne 29 │ │↓ jmp 43 11.47 │20:└─→cmpxch %esi,0x38a999(%rip) That means the cmpl+je is a fused instruction pair and they should be considered together. Changelog: v3: Use Arnaldo's fix to improve the arrow origin rendering. To get the evsel->evlist->env->cpuid, save the evsel in annotate_browser. v2: new function "ins__is_fused" to check if the instructions are fused. Signed-off-by: Yao Jin <yao.jin@linux.intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1499403995-19857-3-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browser.c')
-rw-r--r--tools/perf/ui/browser.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index 83874b0e266c..f73f3f13e01d 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -738,6 +738,35 @@ void __ui_browser__line_arrow(struct ui_browser *browser, unsigned int column,
738 __ui_browser__line_arrow_down(browser, column, start, end); 738 __ui_browser__line_arrow_down(browser, column, start, end);
739} 739}
740 740
741void ui_browser__mark_fused(struct ui_browser *browser, unsigned int column,
742 unsigned int row, bool arrow_down)
743{
744 unsigned int end_row;
745
746 if (row >= browser->top_idx)
747 end_row = row - browser->top_idx;
748 else
749 return;
750
751 SLsmg_set_char_set(1);
752
753 if (arrow_down) {
754 ui_browser__gotorc(browser, end_row, column - 1);
755 SLsmg_write_char(SLSMG_ULCORN_CHAR);
756 ui_browser__gotorc(browser, end_row, column);
757 SLsmg_draw_hline(2);
758 ui_browser__gotorc(browser, end_row + 1, column - 1);
759 SLsmg_write_char(SLSMG_LTEE_CHAR);
760 } else {
761 ui_browser__gotorc(browser, end_row, column - 1);
762 SLsmg_write_char(SLSMG_LTEE_CHAR);
763 ui_browser__gotorc(browser, end_row, column);
764 SLsmg_draw_hline(2);
765 }
766
767 SLsmg_set_char_set(0);
768}
769
741void ui_browser__init(void) 770void ui_browser__init(void)
742{ 771{
743 int i = 0; 772 int i = 0;