From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752647AbdIVQbO (ORCPT ); Fri, 22 Sep 2017 12:31:14 -0400 Received: from terminus.zytor.com ([65.50.211.136]:45631 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbdIVQbM (ORCPT ); Fri, 22 Sep 2017 12:31:12 -0400 Date: Fri, 22 Sep 2017 09:30:04 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: jolsa@kernel.org, ak@linux.intel.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@redhat.com Reply-To: hpa@zytor.com, jolsa@kernel.org, ak@linux.intel.com, mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <20170831194036.30146-5-andi@firstfloor.org> References: <20170831194036.30146-5-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf stat: Print generic metric header even for failed expressions Git-Commit-ID: 4ed962eb38c8a33b8b6ded911410afaefa1ca48c 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: 4ed962eb38c8a33b8b6ded911410afaefa1ca48c Gitweb: http://git.kernel.org/tip/4ed962eb38c8a33b8b6ded911410afaefa1ca48c Author: Andi Kleen AuthorDate: Thu, 31 Aug 2017 12:40:29 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 13 Sep 2017 09:49:13 -0300 perf stat: Print generic metric header even for failed expressions Print the generic metric header even when the expression evaluation failed. Otherwise an expression that fails on the first collections due to division by zero may suddenly reappear later without an header. Signed-off-by: Andi Kleen Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20170831194036.30146-5-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/stat-shadow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index 96aa6cb..8c7ab29 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -662,7 +662,9 @@ static void generic_metric(const char *metric_expr, out->force_header ? name : "", ratio); else - print_metric(ctxp, NULL, NULL, "", 0); + print_metric(ctxp, NULL, NULL, + out->force_header ? + (metric_name ? metric_name : name) : "", 0); } else print_metric(ctxp, NULL, NULL, "", 0); }