lkml.org 
[lkml]   [2019]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 49/69] perf tools: Use perf_mmap way to detect aux mmap
    Date
    From: Jiri Olsa <jolsa@kernel.org>

    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>
    ---
    tools/perf/util/mmap.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    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)
    --
    2.21.0
    \
     
     \ /
      Last update: 2019-10-11 22:11    [W:4.029 / U:0.412 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site