diff options
authorNamhyung Kim <>2016-11-08 22:08:33 +0900
committerGreg Kroah-Hartman <>2016-11-26 09:56:57 +0100
commitbac1543b764c535d0dd51026f54cc28f8d8adf00 (patch)
parent4cba876de64d448b458dd271f49c0e6a80a639ce (diff)
perf hists: Fix column length on --hierarchy
commit c72ab446cac1d6c9551fd26c4cfef1b2fc5041fd upstream. 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 <> Signed-off-by: Namhyung Kim <> Cc: Jiri Olsa <> Cc: Peter Zijlstra <> Fixes: 1a3906a7e6b9 ("perf hists: Resort hist entries with hierarchy") Link: Signed-off-by: Arnaldo Carvalho de Melo <> Signed-off-by: Greg Kroah-Hartman <>
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index de15dbcdcecf..7214913861cf 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1596,18 +1596,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,
- hists->nr_entries++;
- if (!he->filtered) {
- hists->nr_non_filtered_entries++;
- hists__calc_col_len(hists, he);
- }