[tip: perf/core] libperf: Move mask setup to perf_evlist__mmap_ops()
From: tip-bot2 for Jiri Olsa
Date: Mon Oct 21 2019 - 20:03:38 EST
The following commit has been merged into the perf/core branch of tip:
Commit-ID: b6cd35e4e09c12f9478ed98cb015d4352fa98056
Gitweb: https://git.kernel.org/tip/b6cd35e4e09c12f9478ed98cb015d4352fa98056
Author: Jiri Olsa <jolsa@xxxxxxxxxx>
AuthorDate: Thu, 17 Oct 2019 12:59:11 +02:00
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitterDate: Sat, 19 Oct 2019 15:35:01 -03:00
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@xxxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Alexey Budankov <alexey.budankov@xxxxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
Cc: Michael Petlan <mpetlan@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lore.kernel.org/lkml/20191017105918.20873-4-jolsa@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/lib/evlist.c | 3 ++-
tools/perf/util/evlist.c | 1 -
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c
index 73aac6b..205ddbb 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);
}
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 5cded4e..fdce590 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -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);