Commit f1db5a1d authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf stat: Fix condition in print_interval()

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.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: https://lore.kernel.org/r/20221107213314.3239159-9-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1cc7642a
...@@ -900,8 +900,8 @@ static void print_interval(struct perf_stat_config *config, ...@@ -900,8 +900,8 @@ static void print_interval(struct perf_stat_config *config,
sprintf(prefix, "{\"interval\" : %lu.%09lu}", (unsigned long) sprintf(prefix, "{\"interval\" : %lu.%09lu}", (unsigned long)
ts->tv_sec, ts->tv_nsec); ts->tv_sec, ts->tv_nsec);
if ((num_print_interval == 0 && !config->csv_output && !config->json_output) if ((num_print_interval == 0 || config->interval_clear) &&
|| config->interval_clear) { !config->csv_output && !config->json_output) {
switch (config->aggr_mode) { switch (config->aggr_mode) {
case AGGR_NODE: case AGGR_NODE:
fprintf(output, "# time node cpus"); fprintf(output, "# time node cpus");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment