summaryrefslogtreecommitdiffstats
path: root/tools/perf/lib/mmap.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-10-17 12:59:09 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-10-19 20:35:01 +0200
commit6eb65f7a5cc553f5dffb5cea3a874f1087524d99 (patch)
tree0a51ce3888aae612aeba90891f78c261fc0c361c /tools/perf/lib/mmap.c
parentperf tests: Disable bp_signal testing for arm64 (diff)
downloadlinux-6eb65f7a5cc553f5dffb5cea3a874f1087524d99.tar.xz
linux-6eb65f7a5cc553f5dffb5cea3a874f1087524d99.zip
libperf: Introduce perf_evlist__for_each_mmap()
Add the perf_evlist__for_each_mmap() function and export it in the perf/evlist.h header, so that the user can iterate through 'struct perf_mmap' objects. Add a internal perf_mmap__link() function to do the actual linking. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20191017105918.20873-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib/mmap.c')
-rw-r--r--tools/perf/lib/mmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/lib/mmap.c b/tools/perf/lib/mmap.c
index 0752c193b0fb..79d5ed6c38cc 100644
--- a/tools/perf/lib/mmap.c
+++ b/tools/perf/lib/mmap.c
@@ -13,13 +13,15 @@
#include <linux/kernel.h>
#include "internal.h"
-void perf_mmap__init(struct perf_mmap *map, bool overwrite,
- libperf_unmap_cb_t unmap_cb)
+void perf_mmap__init(struct perf_mmap *map, struct perf_mmap *prev,
+ bool overwrite, libperf_unmap_cb_t unmap_cb)
{
map->fd = -1;
map->overwrite = overwrite;
map->unmap_cb = unmap_cb;
refcount_set(&map->refcnt, 0);
+ if (prev)
+ prev->next = map;
}
size_t perf_mmap__mmap_len(struct perf_mmap *map)