Commit 453279d5 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf stat: Move condition to print_footer()



Likewise, I think it'd better to have the control inside the function, and keep
the higher level function clearer.

Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.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/20221114230227.1255976-16-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4c86b664
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1205,6 +1205,9 @@ static void print_footer(struct perf_stat_config *config)
	double avg = avg_stats(config->walltime_nsecs_stats) / NSEC_PER_SEC;
	FILE *output = config->output;

	if (config->interval || config->csv_output || config->json_output)
		return;

	if (!config->null_run)
		fprintf(output, "\n");

@@ -1359,7 +1362,6 @@ void evlist__print_counters(struct evlist *evlist, struct perf_stat_config *conf
		break;
	}

	if (!interval && !config->csv_output && !config->json_output)
	print_footer(config);

	fflush(config->output);