Skip to content

Commit

Permalink
perf tools: Use perf_mmap way to detect aux mmap
Browse files Browse the repository at this point in the history
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 <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 <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20191007125344.14268-9-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Oct 10, 2019
1 parent 80e53d1 commit 1d40ae4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/perf/util/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1d40ae4

Please sign in to comment.