diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-10-07 14:53:21 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-10-10 12:15:58 -0300 |
commit | d1a177595b3a824c72dacb0f9d1a4e5906eaef0e (patch) | |
tree | bc1e23a5dbb635b70bfa57cd7bc8af91d2f9914d /tools/perf/lib/include | |
parent | 151ed5d70da87720022e4171227733a008b3c719 (diff) | |
download | linux-d1a177595b3a824c72dacb0f9d1a4e5906eaef0e.tar.gz linux-d1a177595b3a824c72dacb0f9d1a4e5906eaef0e.tar.bz2 linux-d1a177595b3a824c72dacb0f9d1a4e5906eaef0e.zip |
libperf: Adopt perf_evlist__mmap()/munmap() from tools/perf
Add libperf's version of perf_evlist__mmap()/munmap() functions and
exporting them in the perf/evlist.h header.
It's the backbone of what we have in perf code. The following changes
will add needed callbacks and then we'll finally switch the perf code to
use libperf's version.
Add mmap/mmap_ovw 'struct perf_mmap' object arrays to hold maps for
libperf's evlist.
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-14-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib/include')
-rw-r--r-- | tools/perf/lib/include/internal/evlist.h | 2 | ||||
-rw-r--r-- | tools/perf/lib/include/perf/evlist.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/lib/include/internal/evlist.h b/tools/perf/lib/include/internal/evlist.h index 9f440ab12b76..4438a19ceba3 100644 --- a/tools/perf/lib/include/internal/evlist.h +++ b/tools/perf/lib/include/internal/evlist.h @@ -22,6 +22,8 @@ struct perf_evlist { size_t mmap_len; struct fdarray pollfd; struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; + struct perf_mmap *mmap; + struct perf_mmap *mmap_ovw; }; int perf_evlist__alloc_pollfd(struct perf_evlist *evlist); diff --git a/tools/perf/lib/include/perf/evlist.h b/tools/perf/lib/include/perf/evlist.h index 8a2ce0757ab2..28b6a12a8a2b 100644 --- a/tools/perf/lib/include/perf/evlist.h +++ b/tools/perf/lib/include/perf/evlist.h @@ -33,4 +33,7 @@ LIBPERF_API void perf_evlist__set_maps(struct perf_evlist *evlist, struct perf_thread_map *threads); LIBPERF_API int perf_evlist__poll(struct perf_evlist *evlist, int timeout); +LIBPERF_API int perf_evlist__mmap(struct perf_evlist *evlist, int pages); +LIBPERF_API void perf_evlist__munmap(struct perf_evlist *evlist); + #endif /* __LIBPERF_EVLIST_H */ |