Re: [PATCH 3/4] perf, tools, stat: Fix IPC and other formulas with -A

Jiri Olsa
2015-03-09T08:12:19Z

On Sun, Mar 08, 2015 at 04:55:23PM -0700, Andi Kleen wrote:

SNIP

> - update_stats(&runtime_dtlb_cache_stats[ctx][0], count[0]);
> + update_stats(&runtime_dtlb_cache_stats[ctx][cpu], count[0]);
> else if (perf_evsel__match(counter, HW_CACHE, HW_CACHE_ITLB))
> - update_stats(&runtime_itlb_cache_stats[ctx][0], count[0]);
> + update_stats(&runtime_itlb_cache_stats[ctx][cpu], count[0]);
> }
>
> static void zero_per_pkg(struct perf_evsel *counter)
> @@ -463,7 +464,8 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int thread __maybe_unused,
> perf_evsel__compute_deltas(evsel, cpu, count);
> perf_counts_values__scale(count, scale, NULL);
> evsel->counts->cpu[cpu] = *count;
> - update_shadow_stats(evsel, count->values);
> + if (aggr_mode == AGGR_NONE)
> + update_shadow_stats(evsel, count->values, cpu);

this will also prevent the 'socket' and 'core' aggregation
not to print bogus data for socket/core cpu 0, we'll need
to aggregate shadow stats first to support that.. anyway:

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka