Skip to contentSkip to conversation

perf hists browser: Left justify column headers

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jul 16, 2014 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  1561880d7b114a65e307d1ac9a0991dc715355b3
Gitweb:     http://git.kernel.org/tip/1561880d7b114a65e307d1ac9a0991dc715355b3
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 7 Jul 2014 15:23:44 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 7 Jul 2014 15:23:44 -0300

perf hists browser: Left justify column headers

Looks better and avoids it moving to the end of the screen as the column width changes over time in 'perf top'.

Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Don Zickus <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/util/sort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/sort.c +1 -1
index 1ec57dd..14e5a03 100644
@@ -1215,7 +1215,7 @@ static int __sort__hpp_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
 	hse = container_of(fmt, struct hpp_sort_entry, hpp);
 	len = hists__col_len(&evsel->hists, hse->se->se_width_idx);
 
-	return scnprintf(hpp->buf, hpp->size, "%*s", len, hse->se->se_header);
+	return scnprintf(hpp->buf, hpp->size, "%-*s", len, hse->se->se_header);
 }
 
 static int __sort__hpp_width(struct perf_hpp_fmt *fmt,