summaryrefslogtreecommitdiff
path: root/tools/perf/util/evlist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-10-07 14:53:10 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-10-10 09:40:00 -0300
commite440979faf6ac8048e1792af383df6af78dd1cb0 (patch)
treede71687f93ffcca4115986d57b9d9dc78409b8ab /tools/perf/util/evlist.c
parent353120b48d4f61288e4745b0c8a191784b11c0f4 (diff)
downloadlwn-e440979faf6ac8048e1792af383df6af78dd1cb0.tar.gz
lwn-e440979faf6ac8048e1792af383df6af78dd1cb0.zip
libperf: Add 'struct perf_mmap_param'
Add libperf's version of mmap params 'struct perf_mmap_param' object with the basics: 'prot' and 'mask'. Encapsulate it in the current 'struct mmap_params' object. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20191007125344.14268-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r--tools/perf/util/evlist.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 6c8de0865670..3a19a7cb95b1 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -667,7 +667,7 @@ static int evlist__mmap_per_evsel(struct evlist *evlist, int idx,
int fd;
int cpu;
- mp->prot = PROT_READ | PROT_WRITE;
+ mp->core.prot = PROT_READ | PROT_WRITE;
if (evsel->core.attr.write_backward) {
output = _output_overwrite;
maps = evlist->overwrite_mmap;
@@ -680,7 +680,7 @@ static int evlist__mmap_per_evsel(struct evlist *evlist, int idx,
if (evlist->bkw_mmap_state == BKW_MMAP_NOTREADY)
perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING);
}
- mp->prot &= ~PROT_WRITE;
+ mp->core.prot &= ~PROT_WRITE;
}
if (evsel->core.system_wide && thread)
@@ -921,8 +921,12 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
* Its value is decided by evsel's write_backward.
* So &mp should not be passed through const pointer.
*/
- struct mmap_params mp = { .nr_cblocks = nr_cblocks, .affinity = affinity, .flush = flush,
- .comp_level = comp_level };
+ struct mmap_params mp = {
+ .nr_cblocks = nr_cblocks,
+ .affinity = affinity,
+ .flush = flush,
+ .comp_level = comp_level
+ };
if (!evlist->mmap)
evlist->mmap = evlist__alloc_mmap(evlist, false);
@@ -934,7 +938,7 @@ 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.mask = evlist->core.mmap_len - page_size - 1;
+ 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);