print_noise_pct(config, stddev_stats(&ps->res_stats[0]), avg);
}
+static void print_cgroup(struct perf_stat_config *config, struct perf_evsel *evsel)
+{
+ if (nr_cgroups) {
+ const char *cgrp_name = evsel->cgrp ? evsel->cgrp->name : "";
+ fprintf(config->output, "%s%s", config->csv_sep, cgrp_name);
+ }
+}
+
+
static void aggr_printout(struct perf_stat_config *config,
struct perf_evsel *evsel, int id, int nr)
{
fprintf(output, "%-*s", config->csv_output ? 0 : 25, perf_evsel__name(evsel));
- if (evsel->cgrp)
- fprintf(output, "%s%s", config->csv_sep, evsel->cgrp->name);
+ print_cgroup(config, evsel);
}
static bool is_mixed_hw_group(struct perf_evsel *counter)
config->csv_output ? 0 : -25,
perf_evsel__name(counter));
- if (counter->cgrp)
- fprintf(config->output, "%s%s",
- config->csv_sep, counter->cgrp->name);
+ print_cgroup(config, counter);
if (!config->csv_output)
pm(config, &os, NULL, NULL, "", 0);