Em Tue, Jan 04, 2011 at 02:59:00PM +0100, Stephane Eranian escreveu:
Well, it shoudldn't, as we do, before calling that function:
list_for_each_entry(pos, &evsel_list, node) {
if (perf_evsel__alloc_stat_priv(pos) < 0 ||
perf_evsel__alloc_counts(pos, cpus->nr) < 0 ||
perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0)
goto out_free_fd;
}
And then at line 206 it does:
update_stats(&ps->res_stats[i], count[i]);
ps was set to be:
struct perf_stat *ps = counter->priv;
that was set by perf_evsel__alloc_stat_priv
and count is
u64 *count = counter->counts->aggr.values;
That was allocated by perf_evsel__alloc_counts
/me scratches head :-\
- Arnaldo
--