diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-11-08 08:08:33 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-09 09:55:29 -0500 |
commit | c72ab446cac1d6c9551fd26c4cfef1b2fc5041fd (patch) | |
tree | 9002075620e99bf0b6fd5a7d8d2f83798b0560d0 | |
parent | b9bf911e990a189f89147ee6b66660a153ed0125 (diff) |
perf hists: Fix column length on --hierarchy
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>
-rw-r--r-- | tools/perf/util/hist.c | 12 |
1 files 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, | |||
1600 | if (prog) | 1600 | if (prog) |
1601 | ui_progress__update(prog, 1); | 1601 | ui_progress__update(prog, 1); |
1602 | 1602 | ||
1603 | hists->nr_entries++; | ||
1604 | if (!he->filtered) { | ||
1605 | hists->nr_non_filtered_entries++; | ||
1606 | hists__calc_col_len(hists, he); | ||
1607 | } | ||
1608 | |||
1603 | if (!he->leaf) { | 1609 | if (!he->leaf) { |
1604 | hists__hierarchy_output_resort(hists, prog, | 1610 | hists__hierarchy_output_resort(hists, prog, |
1605 | &he->hroot_in, | 1611 | &he->hroot_in, |
1606 | &he->hroot_out, | 1612 | &he->hroot_out, |
1607 | min_callchain_hits, | 1613 | min_callchain_hits, |
1608 | use_callchain); | 1614 | use_callchain); |
1609 | hists->nr_entries++; | ||
1610 | if (!he->filtered) { | ||
1611 | hists->nr_non_filtered_entries++; | ||
1612 | hists__calc_col_len(hists, he); | ||
1613 | } | ||
1614 | |||
1615 | continue; | 1615 | continue; |
1616 | } | 1616 | } |
1617 | 1617 | ||