Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519875

[PATCH 5/5] perf hists: Fix column length on --hierarchy

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 5/5] perf hists: Fix column length on --hierarchy
Date 2016-11-11 17:00 +0100
Message-ID <sCmpc-6c5-35@gated-at.bofh.it> (permalink)
References <sCmpb-6c5-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Namhyung Kim <namhyung@kernel.org>

Markus reported that there's a weird behavior on perf top --hierarchy
regarding the column length.

Looking at the code, I found a dubious code which affects the symptoms.
When --hierarchy option is used, the last column length might be
inaccurate since it skips to update the length on leaf entries.

I cannot remember why it did and looks like a leftover from previous
version during the development.

Anyway, updating the column length often is not harmful.  So let's move
the code out.

Reported-and-Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 1a3906a7e6b9 ("perf hists: Resort hist entries with hierarchy")
Link: http://lkml.kernel.org/r/20161108130833.9263-5-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index b02992efb513..a69f027368ef 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1600,18 +1600,18 @@ static void hists__hierarchy_output_resort(struct hists *hists,
 		if (prog)
 			ui_progress__update(prog, 1);
 
+		hists->nr_entries++;
+		if (!he->filtered) {
+			hists->nr_non_filtered_entries++;
+			hists__calc_col_len(hists, he);
+		}
+
 		if (!he->leaf) {
 			hists__hierarchy_output_resort(hists, prog,
 						       &he->hroot_in,
 						       &he->hroot_out,
 						       min_callchain_hits,
 						       use_callchain);
-			hists->nr_entries++;
-			if (!he->filtered) {
-				hists->nr_non_filtered_entries++;
-				hists__calc_col_len(hists, he);
-			}
-
 			continue;
 		}
 
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 0/5] perf/urgent hists hierarchy fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-11 17:00 +0100
  [PATCH 1/5] perf hist browser: Fix hierarchy column counts Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-11 17:00 +0100
  [PATCH 4/5] perf hists browser: Fix column indentation on --hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-11 17:00 +0100
  [PATCH 3/5] perf hists browser: Show folded sign properly on --hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-11 17:00 +0100
  [PATCH 5/5] perf hists: Fix column length on --hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-11-11 17:00 +0100
  Re: [GIT PULL 0/5] perf/urgent hists hierarchy fixes Ingo Molnar <mingo@kernel.org> - 2016-11-12 11:50 +0100

csiph-web