lkml.org 
[lkml]   [2015]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH 03/38] perf tools: Move auxtrace_mmap field to struct perf_evlist
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


\
 
 \ /
  Last update: 2015-10-06 11:01    [W:0.137 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site