Re: [PATCHv3 5/5] perf tools: Add perf data cache feature

From: Arnaldo Carvalho de Melo
Date: Tue Feb 16 2016 - 10:48:41 EST


Em Tue, Feb 16, 2016 at 12:29:36PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Feb 16, 2016 at 04:01:43PM +0100, Jiri Olsa escreveu:
> > + caches = zalloc(sizeof(struct cache_level) * cnt);
> > + if (!caches)
> > + return -1;
> > +
> > + for (i = 0; i < cnt; i++) {
> > + struct cache_level c;
> > +
> > + #define _R(v) \
> > + if (readn(fd, &c.v, sizeof(u32)) != sizeof(u32))\
> > + return -1; \
>
> So in this case that 'caches' variable leaks?
>

Ok, I fixed this and did the rename to cpu_cache_level, tested and
merged it, going to the next patchkit.

Thanks! Useful feature, we should use it in other places, like: record
same workload in different machines, say Ivy Bridge and Broadwell, do
'perf diff' and see the CPU cache topology difference in addition to
other symbolic, per DSO, etc diffs.

- Arnaldo