diff options
Diffstat (limited to 'tools/perf/lib/evlist.c')
-rw-r--r-- | tools/perf/lib/evlist.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index f9a802d2ceb5..5ae1da97d2e6 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c @@ -34,6 +34,7 @@ void perf_evlist__init(struct perf_evlist *evlist) INIT_HLIST_HEAD(&evlist->heads[i]); INIT_LIST_HEAD(&evlist->entries); evlist->nr_entries = 0; + fdarray__init(&evlist->pollfd, 64); } static void __perf_evlist__propagate_maps(struct perf_evlist *evlist, @@ -114,6 +115,7 @@ void perf_evlist__delete(struct perf_evlist *evlist) return; perf_evlist__munmap(evlist); + fdarray__exit(&evlist->pollfd); free(evlist); } @@ -525,6 +527,9 @@ int perf_evlist__mmap_ops(struct perf_evlist *evlist, return -ENOMEM; } + if (evlist->pollfd.entries == NULL && perf_evlist__alloc_pollfd(evlist) < 0) + return -ENOMEM; + if (perf_cpu_map__empty(cpus)) return mmap_per_thread(evlist, ops, mp); |