aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2019-10-07 14:53:16 +0200
committerArnaldo Carvalho de Melo <[email protected]>2019-10-10 10:11:54 -0300
commit1d40ae4e1784bfa1646fd153ca022db21511284f (patch)
tree7c817908f815dcf50eeaa88fee695a03942058a5
parent80e53d1148231d7d4fdc4cd89e5393616b33bf82 (diff)
perf tools: Use perf_mmap way to detect aux mmap
We will move this code to libperf shortly, so we need to free it of 'struct auxtrace_mmap' usage, because it won't be available in libperf (for now). The perf_event_mmap_page::aux_size is set when the aux mmap is mapped, so the check is equivalent. Signed-off-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/mmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 9f150d50cea5..f246dd403507 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -107,7 +107,9 @@ union perf_event *perf_mmap__read_event(struct mmap *map)
static bool perf_mmap__empty(struct mmap *map)
{
- return perf_mmap__read_head(map) == map->core.prev && !map->auxtrace_mmap.base;
+ struct perf_event_mmap_page *pc = map->core.base;
+
+ return perf_mmap__read_head(map) == map->core.prev && !pc->aux_size;
}
void perf_mmap__consume(struct mmap *map)