Commit b80132b1 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf evlist: Introduce perf_evlist__mmap_cb_mmap()

Add the perf_evlist__mmap_cb_mmap() function to call perf specific
mmap__mmap() function during perf_evlist__mmap_ops() call.
Signed-off-by: default avatarJiri 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-21-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent bb1b1885
...@@ -773,6 +773,16 @@ perf_evlist__mmap_cb_get(struct perf_evlist *_evlist, bool overwrite, int idx) ...@@ -773,6 +773,16 @@ perf_evlist__mmap_cb_get(struct perf_evlist *_evlist, bool overwrite, int idx)
return &maps[idx].core; return &maps[idx].core;
} }
static int
perf_evlist__mmap_cb_mmap(struct perf_mmap *_map, struct perf_mmap_param *_mp,
int output, int cpu)
{
struct mmap *map = container_of(_map, struct mmap, core);
struct mmap_params *mp = container_of(_mp, struct mmap_params, core);
return mmap__mmap(map, mp, output, cpu);
}
static int evlist__mmap_per_cpu(struct evlist *evlist, static int evlist__mmap_per_cpu(struct evlist *evlist,
struct mmap_params *mp) struct mmap_params *mp)
{ {
...@@ -970,8 +980,9 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages, ...@@ -970,8 +980,9 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
.comp_level = comp_level .comp_level = comp_level
}; };
struct perf_evlist_mmap_ops ops __maybe_unused = { struct perf_evlist_mmap_ops ops __maybe_unused = {
.idx = perf_evlist__mmap_cb_idx, .idx = perf_evlist__mmap_cb_idx,
.get = perf_evlist__mmap_cb_get, .get = perf_evlist__mmap_cb_get,
.mmap = perf_evlist__mmap_cb_mmap,
}; };
if (!evlist->mmap) if (!evlist->mmap)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment