perf stat: Switch aggregation to use for_each loop