Skip to contentSkip to conversation

perf report: Fix broken arrow at row 0 in annotate view

PATCH In review Jin Yao 3 participants 5 messages Jun 8, 2017 – Jul 11, 2017 perf events

lore
Share & tools
lore

Jin Yao

author
#0 lore raw

PATCH 1/1 perf report: Fix broken arrow at row 0 in annotate view

When the jump instruction is displayed at the row 0 in annotate view, the arrow is broken. An example:

 16.86 │   ┌──je     82
  0.01 │      movsd  (%rsp),%xmm0
       │      movsd  0x8(%rsp),%xmm4
       │      movsd  0x8(%rsp),%xmm1
       │      movsd  (%rsp),%xmm3
       │      divsd  %xmm4,%xmm0
       │      divsd  %xmm3,%xmm1
       │      movsd  (%rsp),%xmm2
       │      addsd  %xmm1,%xmm0
       │      addsd  %xmm2,%xmm0
       │      movsd  %xmm0,(%rsp)
       │82:   sub    $0x1,%ebx
 83.03 │    ↑ jne    38
       │      add    $0x10,%rsp
       │      xor    %eax,%eax
       │      pop    %rbx
       │    ← retq

The patch increments the row number before checking with 0.

---
 tools/perf/ui/browser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
index a4d3762..83874b0 100644
@@ -704,7 +704,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
 		ui_browser__gotorc(browser, row, column + 1);
 		SLsmg_draw_hline(2);
 
-		if (row++ == 0)
+		if (++row == 0)
 			goto out;
 	} else
 		row = 0;
Signature · 1 line
2.7.4
author
#1 lore raw

Hi Arnaldo,

Could this patch be merged?

Otherwise the jump arrow is broken when it's displayed at the row 0 in annotate view.

Thanks

Jin Yao

Quoted 41 lines · Jin Yao

When the jump instruction is displayed at the row 0 in annotate view, the arrow is broken. An example:

  16.86 │   ┌──je     82
   0.01 │      movsd  (%rsp),%xmm0
        │      movsd  0x8(%rsp),%xmm4
        │      movsd  0x8(%rsp),%xmm1
        │      movsd  (%rsp),%xmm3
        │      divsd  %xmm4,%xmm0
        │      divsd  %xmm3,%xmm1
        │      movsd  (%rsp),%xmm2
        │      addsd  %xmm1,%xmm0
        │      addsd  %xmm2,%xmm0
        │      movsd  %xmm0,(%rsp)
        │82:   sub    $0x1,%ebx
  83.03 │    ↑ jne    38
        │      add    $0x10,%rsp
        │      xor    %eax,%eax
        │      pop    %rbx
        │    ← retq

The patch increments the row number before checking with 0.

---
  tools/perf/ui/browser.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
index a4d3762..83874b0 100644
@@ -704,7 +704,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
  		ui_browser__gotorc(browser, row, column + 1);
  		SLsmg_draw_hline(2);
 
-		if (row++ == 0)
+		if (++row == 0)
  			goto out;
  	} else
  		row = 0;
#2 lore raw

Em Fri, Jul 07, 2017 at 01:11:42PM +0800, Jin, Yao escreveu:

Quoted 3 lines

Hi Arnaldo,

Could this patch be merged?

I'll test this one and the v4 fused ins series, thanks for following this up!

- Arnaldo

Quoted 48 lines

Otherwise the jump arrow is broken when it's displayed at the row 0 in annotate view.

Thanks

Jin Yao

Quoted 40 lines · Jin Yao

When the jump instruction is displayed at the row 0 in annotate view, the arrow is broken. An example:

  16.86 │   ┌──je     82
   0.01 │      movsd  (%rsp),%xmm0
        │      movsd  0x8(%rsp),%xmm4
        │      movsd  0x8(%rsp),%xmm1
        │      movsd  (%rsp),%xmm3
        │      divsd  %xmm4,%xmm0
        │      divsd  %xmm3,%xmm1
        │      movsd  (%rsp),%xmm2
        │      addsd  %xmm1,%xmm0
        │      addsd  %xmm2,%xmm0
        │      movsd  %xmm0,(%rsp)
        │82:   sub    $0x1,%ebx
  83.03 │    ↑ jne    38
        │      add    $0x10,%rsp
        │      xor    %eax,%eax
        │      pop    %rbx
        │    ← retq

The patch increments the row number before checking with 0.

---
  tools/perf/ui/browser.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
index a4d3762..83874b0 100644
@@ -704,7 +704,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
  		ui_browser__gotorc(browser, row, column + 1);
  		SLsmg_draw_hline(2);
-		if (row++ == 0)
+		if (++row == 0)
  			goto out;
  	} else
  		row = 0;
#3 lore raw
In reply to Jin Yao

Em Thu, Jun 08, 2017 at 02:01:44PM +0800, Jin Yao escreveu:

Quoted 21 lines

When the jump instruction is displayed at the row 0 in annotate view, the arrow is broken. An example:

 16.86 │   ┌──je     82
  0.01 │      movsd  (%rsp),%xmm0
       │      movsd  0x8(%rsp),%xmm4
       │      movsd  0x8(%rsp),%xmm1
       │      movsd  (%rsp),%xmm3
       │      divsd  %xmm4,%xmm0
       │      divsd  %xmm3,%xmm1
       │      movsd  (%rsp),%xmm2
       │      addsd  %xmm1,%xmm0
       │      addsd  %xmm2,%xmm0
       │      movsd  %xmm0,(%rsp)
       │82:   sub    $0x1,%ebx
 83.03 │    ↑ jne    38
       │      add    $0x10,%rsp
       │      xor    %eax,%eax
       │      pop    %rbx
       │    ← retq
Quoted 1 line

The patch increments the row number before checking with 0.

Thanks, tested and applied!

- Arnaldo

#4 lore raw

[tip:perf/urgent] perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target

In reply to Jin Yao
perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target
Commit-ID:  80f62589fa52f530cffc50e78c0b5a2ae572d61e
Gitweb:     http://git.kernel.org/tip/80f62589fa52f530cffc50e78c0b5a2ae572d61e
Author:     Jin Yao <[email protected]>
AuthorDate: Thu, 8 Jun 2017 14:01:44 +0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 10 Jul 2017 16:36:40 -0300

perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target

When the jump instruction is displayed at the row 0 in annotate view, the arrow is broken. An example:

 16.86 │   ┌──je     82
  0.01 │      movsd  (%rsp),%xmm0
       │      movsd  0x8(%rsp),%xmm4
       │      movsd  0x8(%rsp),%xmm1
       │      movsd  (%rsp),%xmm3
       │      divsd  %xmm4,%xmm0
       │      divsd  %xmm3,%xmm1
       │      movsd  (%rsp),%xmm2
       │      addsd  %xmm1,%xmm0
       │      addsd  %xmm2,%xmm0
       │      movsd  %xmm0,(%rsp)
       │82:   sub    $0x1,%ebx
 83.03 │    ↑ jne    38
       │      add    $0x10,%rsp
       │      xor    %eax,%eax
       │      pop    %rbx
       │    ← retq

The patch increments the row number before checking with 0.

Cc Alexander Shishkin <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 944e1abed9e1 ("perf ui browser: Add method to draw up/down arrow line")
---
 tools/perf/ui/browser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
index a4d3762..83874b0 100644
@@ -704,7 +704,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
 		ui_browser__gotorc(browser, row, column + 1);
 		SLsmg_draw_hline(2);
 
-		if (row++ == 0)
+		if (++row == 0)
 			goto out;
 	} else
 		row = 0;