Skip to contentSkip to conversation

perf hists indicator off by two spaces

PATCH In review Markus Trippelsdorf 3 participants 3 messages Oct 14, 2012 – Oct 15, 2012 perf events

lore
Share & tools
lore
#0 lore raw

The indicator line in perf hist is off by two spaces and wraps around to the following line. See attached screenshot.

This started with:

commit 5395a04841fcdd9220177f2c21353fe6d4cd0729

Author: Jiri Olsa <[email protected]>
Date:   Thu Oct 4 21:49:37 2012 +0900

perf hists: Separate overhead and baseline columns

Signature · 1 line
Markus
maintainer
#1 lore raw

PATCH 1/1 perf ui/browser: Fix off-by-two bug on the first column

From: Namhyung Kim <[email protected]>

The commit 5395a04841fc ("perf hists: Separate overhead and baseline columns") makes the "Overhead" column no more the first one. So it resulted in the mis-aligned column in the normal (non-diff) output.

---
 tools/perf/ui/browsers/hists.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/ui/browsers/hists.c +3 -1
index 0568536ecf67..fe4430aed635 100644
@@ -610,6 +610,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 	char folded_sign = ' ';
 	bool current_entry = ui_browser__is_current_entry(&browser->b, row);
 	off_t row_offset = entry->row_offset;
+	bool first = true;
 
 	if (current_entry) {
 		browser->he_selection = entry;
@@ -633,10 +634,11 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 			if (!perf_hpp__format[i].cond)
 				continue;
 
-			if (i) {
+			if (!first) {
 				slsmg_printf("  ");
 				width -= 2;
 			}
+			first = false;
 
 			if (perf_hpp__format[i].color) {
 				hpp.ptr = &percent;
Signature · 1 line
1.7.11.4
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] perf ui/browser: Fix off-by-two bug on the first column

Quoted 9 lines · Namhyung Kim

From: Namhyung Kim <[email protected]>

The commit 5395a04841fc ("perf hists: Separate overhead and baseline columns") makes the "Overhead" column no more the first one. So it resulted in the mis-aligned column in the normal (non-diff) output.

eek, missed that one ;) thanks!