forked from Minki/linux
libperf: Move mask setup to perf_evlist__mmap_ops()
Move the mask setup to perf_evlist__mmap_ops(), because it's the same on both perf and libperf path. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20191017105918.20873-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
3805e4f303
commit
b6cd35e4e0
@ -578,6 +578,8 @@ int perf_evlist__mmap_ops(struct perf_evlist *evlist,
|
||||
if (!ops || !ops->get || !ops->mmap)
|
||||
return -EINVAL;
|
||||
|
||||
mp->mask = evlist->mmap_len - page_size - 1;
|
||||
|
||||
evlist->nr_mmaps = perf_evlist__nr_mmaps(evlist);
|
||||
|
||||
perf_evlist__for_each_entry(evlist, evsel) {
|
||||
@ -605,7 +607,6 @@ int perf_evlist__mmap(struct perf_evlist *evlist, int pages)
|
||||
};
|
||||
|
||||
evlist->mmap_len = (pages + 1) * page_size;
|
||||
mp.mask = evlist->mmap_len - page_size - 1;
|
||||
|
||||
return perf_evlist__mmap_ops(evlist, &ops, &mp);
|
||||
}
|
||||
|
@ -813,7 +813,6 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
|
||||
|
||||
evlist->core.mmap_len = evlist__mmap_size(pages);
|
||||
pr_debug("mmap size %zuB\n", evlist->core.mmap_len);
|
||||
mp.core.mask = evlist->core.mmap_len - page_size - 1;
|
||||
|
||||
auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->core.mmap_len,
|
||||
auxtrace_pages, auxtrace_overwrite);
|
||||
|
Loading…
Reference in New Issue
Block a user