diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-10-07 14:53:34 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-10-10 12:58:45 -0300 |
commit | 84227cb11ff4d9815b9b1daf0c1a2bd7e9274c58 (patch) | |
tree | c08bacbf45565766dd79e7a727329a288ea9d7da /tools/perf/util/evlist.c | |
parent | 696f27c994ed056fd176ce9dc51c7988e148e4b0 (diff) | |
download | linux-84227cb11ff4d9815b9b1daf0c1a2bd7e9274c58.tar.gz linux-84227cb11ff4d9815b9b1daf0c1a2bd7e9274c58.tar.bz2 linux-84227cb11ff4d9815b9b1daf0c1a2bd7e9274c58.zip |
libperf: Adopt perf_evlist__filter_pollfd() from tools/perf
Introduce the perf_evlist__filter_pollfd function and export it in the
perf/evlist.h header, so that libperf users can check if the descriptor
is still alive.
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-27-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.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 031ace3696a2..21b77efa802c 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -423,19 +423,9 @@ int evlist__add_pollfd(struct evlist *evlist, int fd) return perf_evlist__add_pollfd(&evlist->core, fd, NULL, POLLIN); } -static void perf_evlist__munmap_filtered(struct fdarray *fda, int fd, - void *arg __maybe_unused) -{ - struct perf_mmap *map = fda->priv[fd].ptr; - - if (map) - perf_mmap__put(map); -} - int evlist__filter_pollfd(struct evlist *evlist, short revents_and_mask) { - return fdarray__filter(&evlist->core.pollfd, revents_and_mask, - perf_evlist__munmap_filtered, NULL); + return perf_evlist__filter_pollfd(&evlist->core, revents_and_mask); } int evlist__poll(struct evlist *evlist, int timeout) |