Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756873AbcKLVRF (ORCPT ); Sat, 12 Nov 2016 16:17:05 -0500 Received: from terminus.zytor.com ([198.137.202.10]:43456 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966748AbcKLVRA (ORCPT ); Sat, 12 Nov 2016 16:17:00 -0500 Date: Sat, 12 Nov 2016 02:54:39 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: hpa@zytor.com, acme@redhat.com, namhyung@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, markus@trippelsdorf.de, mingo@kernel.org Reply-To: hpa@zytor.com, acme@redhat.com, namhyung@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, markus@trippelsdorf.de, mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de In-Reply-To: <20161108130833.9263-5-namhyung@kernel.org> References: <20161108130833.9263-5-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf hists: Fix column length on --hierarchy Git-Commit-ID: c72ab446cac1d6c9551fd26c4cfef1b2fc5041fd X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2111 Lines: 62 Commit-ID: c72ab446cac1d6c9551fd26c4cfef1b2fc5041fd Gitweb: http://git.kernel.org/tip/c72ab446cac1d6c9551fd26c4cfef1b2fc5041fd Author: Namhyung Kim AuthorDate: Tue, 8 Nov 2016 22:08:33 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 9 Nov 2016 11:55:29 -0300 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 Signed-off-by: Namhyung Kim Cc: Jiri Olsa Cc: Peter Zijlstra 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 --- 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 b02992e..a69f027 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; }