aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/lib/include/internal/evlist.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-10-07 14:53:25 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-10-10 12:22:21 -0300
commitb5911e7ac28cb34f21b7380915ce98518078f114 (patch)
treebf0ec46e80fd69cf1c9d3b107cef2e8b8693f2ea /tools/perf/lib/include/internal/evlist.h
parentlibperf: Add perf_evlist_mmap_ops::get callback (diff)
downloadlinux-dev-b5911e7ac28cb34f21b7380915ce98518078f114.tar.xz
linux-dev-b5911e7ac28cb34f21b7380915ce98518078f114.zip
libperf: Introduce perf_evlist_mmap_ops::mmap callback
Add the perf_evlist_mmap_ops::mmap callback to be called in mmap_per_evsel() to actually mmap the map. Add libperf's perf_evlist__mmap_cb_mmap() function as libperf's mmap callback. New mmaped map gets refcount set to 2 in mmap__mmap(), we follow that in mmap callback. We will move this to common place after we switch to perf_evlist__mmap(). 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-18-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/perf/lib/include/internal/evlist.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/lib/include/internal/evlist.h b/tools/perf/lib/include/internal/evlist.h
index 9bc3a21643ea..b2019700cdc0 100644
--- a/tools/perf/lib/include/internal/evlist.h
+++ b/tools/perf/lib/include/internal/evlist.h
@@ -31,10 +31,13 @@ typedef void
(*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_mmap_param*, int, bool);
typedef struct perf_mmap*
(*perf_evlist_mmap__cb_get_t)(struct perf_evlist*, bool, int);
+typedef int
+(*perf_evlist_mmap__cb_mmap_t)(struct perf_mmap*, struct perf_mmap_param*, int, int);
struct perf_evlist_mmap_ops {
perf_evlist_mmap__cb_idx_t idx;
perf_evlist_mmap__cb_get_t get;
+ perf_evlist_mmap__cb_mmap_t mmap;
};
int perf_evlist__alloc_pollfd(struct perf_evlist *evlist);