aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/lib
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-10-17 12:59:11 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-10-19 15:35:01 -0300
commitb6cd35e4e09c12f9478ed98cb015d4352fa98056 (patch)
tree9e278a28e6e8a2a490e709dca3a5089f7b932281 /tools/perf/lib
parentlibperf: Move mmap allocation to perf_evlist__mmap_ops::get (diff)
downloadlinux-dev-b6cd35e4e09c12f9478ed98cb015d4352fa98056.tar.xz
linux-dev-b6cd35e4e09c12f9478ed98cb015d4352fa98056.zip
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>
Diffstat (limited to 'tools/perf/lib')
-rw-r--r--tools/perf/lib/evlist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c
index 73aac6bb2ac5..205ddbb80bc1 100644
--- a/tools/perf/lib/evlist.c
+++ b/tools/perf/lib/evlist.c
@@ -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);
}