[PATCH 07/21] perf evlist: Amend mmap ref counting for the AUX area mmap

From: Arnaldo Carvalho de Melo
Date: Mon May 04 2015 - 17:36:55 EST


From: Adrian Hunter <adrian.hunter@xxxxxxxxx>

Reference counting of the mmap buffer does not work correctly when there
is an AUX area mmap also.

In snapshot mode it is not easy to know if the AUX area mmap buffer
contains usefull information. Equally the evlist does not know if the
recording is in sanpshot mode anyway.

Consequently, for now just assume the AUX area mmap always has data,
which will just cause the mmap buffer to remain mmapped for the duration
of the recording.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/r/1429903807-20559-2-git-send-email-adrian.hunter@xxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/evlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 0ec8c3b..7ec1bf9 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -695,7 +695,7 @@ union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx)

static bool perf_mmap__empty(struct perf_mmap *md)
{
- return perf_mmap__read_head(md) == md->prev;
+ return perf_mmap__read_head(md) == md->prev && !md->auxtrace_mmap.base;
}

static void perf_evlist__mmap_get(struct perf_evlist *evlist, int idx)
--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/