summaryrefslogtreecommitdiff
path: root/tools/perf/util/mmap.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-27 22:42:56 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-09-25 09:51:46 -0300
commit8df7a869818ec278969d34e4792985f12b24f23d (patch)
treed7cac6bb7b2b342b0b26d7710e002737e4fa2074 /tools/perf/util/mmap.c
parentebe4d72bba86a499ea0935c58ba1c2aea5aafb43 (diff)
libperf: Add 'overwrite' to 'struct perf_mmap'
Move 'overwrite' from tools/perf's mmap to libperf's perf_mmap struct. Committer notes: Add stdbool.h as we start using 'bool'. 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-17-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/mmap.c')
-rw-r--r--tools/perf/util/mmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 6ce70ff005cb..a8850ce2c2ff 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -93,12 +93,12 @@ union perf_event *perf_mmap__read_event(struct mmap *map)
return NULL;
/* non-overwirte doesn't pause the ringbuffer */
- if (!map->overwrite)
+ if (!map->core.overwrite)
map->core.end = perf_mmap__read_head(map);
event = perf_mmap__read(map, &map->core.start, map->core.end);
- if (!map->overwrite)
+ if (!map->core.overwrite)
map->core.prev = map->core.start;
return event;
@@ -124,7 +124,7 @@ void perf_mmap__put(struct mmap *map)
void perf_mmap__consume(struct mmap *map)
{
- if (!map->overwrite) {
+ if (!map->core.overwrite) {
u64 old = map->core.prev;
perf_mmap__write_tail(map, old);
@@ -447,15 +447,15 @@ static int __perf_mmap__read_init(struct mmap *md)
unsigned char *data = md->core.base + page_size;
unsigned long size;
- md->core.start = md->overwrite ? head : old;
- md->core.end = md->overwrite ? old : head;
+ md->core.start = md->core.overwrite ? head : old;
+ md->core.end = md->core.overwrite ? old : head;
if ((md->core.end - md->core.start) < md->flush)
return -EAGAIN;
size = md->core.end - md->core.start;
if (size > (unsigned long)(md->core.mask) + 1) {
- if (!md->overwrite) {
+ if (!md->core.overwrite) {
WARN_ONCE(1, "failed to keep up with mmap data. (warn only once)\n");
md->core.prev = head;