Skip to contentSkip to conversation

perf annotate tui: Use annotate_browser__cycles_width() mroe

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Mar 25, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  00ea0eb21e9ba38636608e3eb0ac332fc022d5bb
Gitweb:     https://git.kernel.org/tip/00ea0eb21e9ba38636608e3eb0ac332fc022d5bb
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 15 Mar 2018 10:28:06 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 20 Mar 2018 13:19:27 -0300

perf annotate tui: Use annotate_browser__cycles_width() mroe

Instead of an open coded equivalent, will reduce a bit noise in the following patches.

---
 tools/perf/ui/browsers/annotate.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/ui/browsers/annotate.c +2 -3
index ca3d99c1e4d9..0f84a52b4088 100644
@@ -308,7 +308,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
 	struct map_symbol *ms = ab->b.priv;
 	struct symbol *sym = ms->sym;
 	u8 pcnt_width = annotate_browser__pcnt_width(ab);
-	int width = 0;
+	int width;
 
 	/* PLT symbols contain external offsets */
 	if (strstr(sym->name, "@plt"))
@@ -355,8 +355,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
 		to = (u64)btarget->idx;
 	}
 
-	if (ab->have_cycles)
-		width = ANNOTATION__IPC_WIDTH + ANNOTATION__CYCLES_WIDTH;
+	width = annotate_browser__cycles_width(ab);
 
 	ui_browser__set_color(browser, HE_COLORSET_JUMP_ARROWS);
 	__ui_browser__line_arrow(browser,