Commit 6d74ed36 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

perf stat: Move summary prefix printing logic in CSV output



It matches to the prefix (interval timestamp), so better to have them together.
No functional change intended.

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: Athira Jajeev <atrajeev@linux.vnet.ibm.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/20221123180208.2068936-3-namhyung@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 15792642
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -713,11 +713,6 @@ static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int
		nl = config->metric_only ? new_line_metric : new_line_std;
	}

	if (!config->no_csv_summary && config->csv_output &&
	    config->summary && !config->interval && !config->metric_only) {
		fprintf(config->output, "%16s%s", "summary", config->csv_sep);
	}

	if (run == 0 || ena == 0 || counter->counts->scaled == -1) {
		if (config->metric_only) {
			pm(config, &os, NULL, "", "", 0);
@@ -828,8 +823,13 @@ static void print_counter_aggrdata(struct perf_stat_config *config,
	ena = aggr->counts.ena;
	run = aggr->counts.run;

	if (prefix && !metric_only)
	if (!metric_only) {
		if (prefix)
			fprintf(output, "%s", prefix);
		else if (config->summary && config->csv_output &&
			 !config->no_csv_summary && !config->interval)
			fprintf(output, "%16s%s", "summary", config->csv_sep);
	}

	uval = val * counter->scale;