Re: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist

From: Namhyung Kim
Date: Tue Oct 06 2015 - 04:44:55 EST


On Mon, Oct 05, 2015 at 03:14:34PM +0200, Jiri Olsa wrote:
> On Fri, Oct 02, 2015 at 02:18:44PM +0900, Namhyung Kim wrote:
>
> SNIP
>
> > @@ -838,7 +841,7 @@ void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx)
> > perf_mmap__write_tail(md, old);
> > }
> >
> > - if (atomic_read(&md->refcnt) == 1 && perf_mmap__empty(md))
> > + if (atomic_read(&md->refcnt) == 1 && perf_evlist__mmap_empty(evlist, idx))
> > perf_evlist__mmap_put(evlist, idx);
> > }
> >
> > @@ -879,7 +882,7 @@ static void __perf_evlist__munmap(struct perf_evlist *evlist, int idx)
> > evlist->mmap[idx].base = NULL;
> > atomic_set(&evlist->mmap[idx].refcnt, 0);
> > }
> > - auxtrace_mmap__munmap(&evlist->mmap[idx].auxtrace_mmap);
> > + auxtrace_mmap__munmap(&evlist->auxtrace_mmap[idx]);
> > }
> >
> > void perf_evlist__munmap(struct perf_evlist *evlist)
> > @@ -901,7 +904,15 @@ static int perf_evlist__alloc_mmap(struct perf_evlist *evlist)
> > if (cpu_map__empty(evlist->cpus))
> > evlist->nr_mmaps = thread_map__nr(evlist->threads);
> > evlist->mmap = zalloc(evlist->nr_mmaps * sizeof(struct perf_mmap));
> > - return evlist->mmap != NULL ? 0 : -ENOMEM;
> > + if (evlist->mmap == NULL)
> > + return -ENOMEM;
> > + evlist->auxtrace_mmap = calloc(evlist->nr_mmaps,
> > + sizeof(struct auxtrace_mmap));
> > + if (evlist->auxtrace_mmap == NULL) {
> > + zfree(&evlist->mmap);
> > + return -ENOMEM;
> > + }
>
> can't see evlist->auxtrace_mmap being freed

Ooops, will add.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/