summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/mmap.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-27 22:07:44 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-09-25 09:51:45 -0300
commit547740f7b357cd91cca1fab5d7bf3a37469f7587 (patch)
tree0ea56aec93740dc4792bd18efec3006341cf9bf7 /tools/perf/util/mmap.h
parente0fcfb086fbbb6233de1062d4b2f05e9afedab3b (diff)
downloadlinux-547740f7b357cd91cca1fab5d7bf3a37469f7587.tar.bz2
libperf: Add perf_mmap struct
Add the perf_mmap struct to libperf. The definition is added into: include/internal/mmap.h which is not to be included by users, but shared within perf and libperf. Committer notes: Remove unnecessary includes from tools/perf/lib/include/internal/mmap.h, those will be readded as they become necessary, later in the series. 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 <a.p.zijlstra@chello.nl> Link: http://lore.kernel.org/lkml/20190913132355.21634-11-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/mmap.h')
-rw-r--r--tools/perf/util/mmap.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h
index ab086ede044a..d2f0ce581e2c 100644
--- a/tools/perf/util/mmap.h
+++ b/tools/perf/util/mmap.h
@@ -1,6 +1,7 @@
#ifndef __PERF_MMAP_H
#define __PERF_MMAP_H 1
+#include <internal/mmap.h>
#include <linux/compiler.h>
#include <linux/refcount.h>
#include <linux/types.h>
@@ -20,7 +21,7 @@ struct aiocb;
* @refcnt - e.g. code using PERF_EVENT_IOC_SET_OUTPUT to share this
*/
struct mmap {
- void *base;
+ struct perf_mmap core;
int mask;
int fd;
int cpu;
@@ -60,12 +61,12 @@ void perf_mmap__consume(struct mmap *map);
static inline u64 perf_mmap__read_head(struct mmap *mm)
{
- return ring_buffer_read_head(mm->base);
+ return ring_buffer_read_head(mm->core.base);
}
static inline void perf_mmap__write_tail(struct mmap *md, u64 tail)
{
- ring_buffer_write_tail(md->base, tail);
+ ring_buffer_write_tail(md->core.base, tail);
}
union perf_event *perf_mmap__read_forward(struct mmap *map);