lkml.org 
[lkml]   [2022]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/11] perf stat: Fix condition in print_interval()
Date
The num_print_interval and config->interval_clear should be checked
together like other places like later in the function. Otherwise,
the --interval-clear option could print the headers for the CSV or
JSON output unnecessarily.

Acked-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/stat-display.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 03d58277e8d6..5f4fb0bd4037 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -902,8 +902,8 @@ static void print_interval(struct perf_stat_config *config,
sprintf(prefix, "{\"interval\" : %lu.%09lu}", (unsigned long)
ts->tv_sec, ts->tv_nsec);

- if ((num_print_interval == 0 && !config->csv_output && !config->json_output)
- || config->interval_clear) {
+ if ((num_print_interval == 0 || config->interval_clear) &&
+ !config->csv_output && !config->json_output) {
switch (config->aggr_mode) {
case AGGR_NODE:
fprintf(output, "# time node cpus");
--
2.38.1.493.g58b659f92b-goog
\
 
 \ /
  Last update: 2022-11-12 04:24    [W:0.107 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site