Em Thu, Feb 14, 2013 at 01:57:27PM +0100, Stephane Eranian escreveu: > Refactor aggregation code by introducing a single aggr_mode variable > and an enum for aggregation.
<SNIP> > @@ -542,26 +553,37 @@ static void print_noise(struct perf_evsel *evsel, > double avg) > print_noise_pct(stddev_stats(&ps->res_stats[0]), avg); > } > > -static void nsec_printout(int cpu, int nr, struct perf_evsel *evsel, double > avg) > +static void aggr_printout(int cpu, int nr) > { > - double msecs = avg / 1e6; > - char cpustr[16] = { '\0', }; > - const char *fmt = csv_output ? "%s%.6f%s%s" : "%s%18.6f%s%-25s"; > - > - if (aggr_socket) > - sprintf(cpustr, "S%*d%s%*d%s", > + switch (aggr_mode) { > + case AGGR_SOCKET: > + fprintf(output, "S%*d%s%*d%s", > csv_output ? 0 : -5, > cpu, > csv_sep, > csv_output ? 0 : 4, > nr, > csv_sep); > - else if (no_aggr) > - sprintf(cpustr, "CPU%*d%s", > + break; > + case AGGR_NONE: > + fprintf(output, "CPU%*d%s", > csv_output ? 0 : -4, > perf_evsel__cpus(evsel)->map[cpu], csv_sep); I'm fixing this up, how would evsel here work if it is not passed to aggr_printout()? I'm also fixing it up wrt the --forever patch and the one Namyung sent that makes perf stat use perf_evlist__prepare_workload that I had applied before this one. Will do some tests, put on a separate branch for you to check that all is still ok and works as expected, thanks, - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/