linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 05/44] perf stat: Print generic metric header even for failed expressions
Date: Fri, 22 Sep 2017 11:41:41 -0300	[thread overview]
Message-ID: <20170922144220.9411-6-acme@kernel.org> (raw)
In-Reply-To: <20170922144220.9411-1-acme@kernel.org>

From: Andi Kleen <ak@linux.intel.com>

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 <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170831194036.30146-5-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 96aa6cbf24d6..8c7ab29169b9 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);
 }
-- 
2.13.5

  parent reply	other threads:[~2017-09-22 14:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 14:41 [GIT PULL 00/44] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 01/44] perf sched timehist: Add pid and tid options Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 02/44] perf tools: Support weak groups in 'perf stat' Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 03/44] perf vendor events: Support metric_group and no event name in JSON parser Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 04/44] perf stat: Factor out generic metric printing Arnaldo Carvalho de Melo
2017-09-22 14:41 ` Arnaldo Carvalho de Melo [this message]
2017-09-22 14:41 ` [PATCH 06/44] perf pmu: Extract function to get JSON alias map Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 07/44] perf stat: Support JSON metrics in perf stat Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 08/44] perf list: Add metric groups to perf list Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 09/44] perf stat: Don't use ctx for saved values lookup Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 10/44] perf stat: Support duration_time for metrics Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 11/44] perf stat: Hide internal duration_time counter Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 12/44] perf stat: Update walltime_nsecs_stats in interval mode Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 13/44] perf record: Support direct --user-regs arguments Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 14/44] perf script: Support user regs Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 15/44] perf tools: Add python-clean target Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 16/44] perf ui progress: Add ui specific init function Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 17/44] perf ui progress: Add size info into progress bar Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 18/44] perf tools: Use scandir() to replace readdir() Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 19/44] perf config: Write a config file just once Arnaldo Carvalho de Melo
2017-09-22 14:41 ` [PATCH 20/44] perf config: Allow creating empty config set for config file autogeneration Arnaldo Carvalho de Melo
2017-09-22 16:26 ` [GIT PULL 00/44] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170922144220.9411-6-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).