[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170811232634.30465-13-andi@firstfloor.org>
Date: Fri, 11 Aug 2017 16:26:28 -0700
From: Andi Kleen <andi@...stfloor.org>
To: acme@...nel.org
Cc: jolsa@...nel.org, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH v2 13/19] perf, tools: Print generic metric header even for failed expressions
From: Andi Kleen <ak@...ux.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@...ux.intel.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 b6cbb6e67167..4ec2d8d15344 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.9.4
Powered by blists - more mailing lists