static void print_counter_aggrdata(struct perf_stat_config *config,
struct evsel *counter, int s,
- char *prefix, bool metric_only,
- bool *first)
+ char *prefix, bool metric_only)
{
FILE *output = config->output;
u64 ena, run, val;
ena = aggr->counts.ena;
run = aggr->counts.run;
- if (*first && metric_only) {
- *first = false;
- aggr_printout(config, counter, id, aggr->nr);
- }
if (prefix && !metric_only)
fprintf(output, "%s", prefix);
FILE *output = config->output;
struct evsel *counter;
int s;
- bool first;
if (!config->aggr_map || !config->aggr_get_id)
return;
*/
for (s = 0; s < config->aggr_map->nr; s++) {
if (metric_only) {
+ struct perf_stat_aggr *aggr;
+ struct aggr_cpu_id id = config->aggr_map->map[s];
+
if (prefix)
fprintf(output, "%s", prefix);
- else if (config->summary && !config->no_csv_summary &&
- config->csv_output && !config->interval)
- fprintf(output, "%16s%s", "summary", config->csv_sep);
+
+ counter = evlist__first(evlist);
+ aggr = &counter->stats->aggr[s];
+ aggr_printout(config, counter, id, aggr->nr);
}
- first = true;
evlist__for_each_entry(evlist, counter) {
if (counter->merged_stat)
continue;
- print_counter_aggrdata(config, counter, s,
- prefix, metric_only,
- &first);
+ print_counter_aggrdata(config, counter, s, prefix,
+ metric_only);
}
if (metric_only)
fputc('\n', output);
struct evsel *counter, char *prefix)
{
bool metric_only = config->metric_only;
- bool first = false;
int s;
/* AGGR_THREAD doesn't have config->aggr_get_id */
return;
for (s = 0; s < config->aggr_map->nr; s++) {
- print_counter_aggrdata(config, counter, s,
- prefix, metric_only,
- &first);
+ print_counter_aggrdata(config, counter, s, prefix,
+ metric_only);
}
}
FILE *output = config->output;
struct cpu_aggr_map *core_map;
int s, c, i;
- bool first = true;
if (!config->aggr_map || !config->aggr_get_id)
return;
if (found)
continue;
- if (prefix && metric_only)
- fprintf(output, "%s", prefix);
-
- print_counter_aggrdata(config, counter, s,
- prefix, metric_only, &first);
+ print_counter_aggrdata(config, counter, s, prefix, metric_only);
core_map->map[c++] = core_id;
}
}
print_header(config, _target, evlist, argc, argv);
- if (metric_only) {
- if (config->aggr_mode == AGGR_GLOBAL && prefix && !config->iostat_run)
- fprintf(config->output, "%s", prefix);
- }
switch (config->aggr_mode) {
case AGGR_CORE:
iostat_print_counters(evlist, config, ts, prefix = buf,
print_counter);
else {
+ if (prefix && metric_only)
+ fprintf(config->output, "%s", prefix);
evlist__for_each_entry(evlist, counter) {
print_counter(config, counter, prefix);
}