From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756855AbcBCKZM (ORCPT ); Wed, 3 Feb 2016 05:25:12 -0500 Received: from terminus.zytor.com ([198.137.202.10]:54992 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756156AbcBCKZJ (ORCPT ); Wed, 3 Feb 2016 05:25:09 -0500 Date: Wed, 3 Feb 2016 02:24:26 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: peterz@infradead.org, wangnan0@huawei.com, namhyung@kernel.org, dsahern@gmail.com, mingo@kernel.org, jolsa@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, andi@firstfloor.org, hpa@zytor.com, fweisbec@gmail.com Reply-To: jolsa@kernel.org, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, peterz@infradead.org, wangnan0@huawei.com, dsahern@gmail.com, namhyung@kernel.org, hpa@zytor.com, fweisbec@gmail.com, andi@firstfloor.org In-Reply-To: <20160128122454.GA27446@danjae.kornet> References: <20160128122454.GA27446@danjae.kornet> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Don' t show blank lines if entry has no callchain Git-Commit-ID: 3848c23b19e07188bfa15e3d9a2ac27692f2ff3c 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 Commit-ID: 3848c23b19e07188bfa15e3d9a2ac27692f2ff3c Gitweb: http://git.kernel.org/tip/3848c23b19e07188bfa15e3d9a2ac27692f2ff3c Author: Namhyung Kim AuthorDate: Thu, 28 Jan 2016 21:24:54 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Feb 2016 17:51:09 -0300 perf report: Don't show blank lines if entry has no callchain When all callchains of a hist entry is percent-limited, do not add a blank line at the end. It makes the entry look like it doesn't have callchains. Reported-and-Tested-by: Jiri Olsa Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20160128122454.GA27446@danjae.kornet Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/stdio/hist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 76ff46b..691e52c 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c @@ -233,7 +233,10 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root, ret += __callchain__fprintf_graph(fp, root, total_samples, 1, 1, left_margin); - ret += fprintf(fp, "\n"); + if (ret) { + /* do not add a blank line if it printed nothing */ + ret += fprintf(fp, "\n"); + } return ret; }