[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190929154421.GA602@krava>
Date: Sun, 29 Sep 2019 17:44:21 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Steve MacLean <Steve.MacLean@...rosoft.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Eric Saint-Etienne <eric.saint.etienne@...cle.com>,
John Keeping <john@...anate.com>,
Andi Kleen <ak@...ux.intel.com>,
Song Liu <songliubraving@...com>,
Davidlohr Bueso <dave@...olabs.net>,
Leo Yan <leo.yan@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Robbins <brianrob@...rosoft.com>,
Tom McDonald <Thomas.McDonald@...rosoft.com>,
John Salem <josalem@...rosoft.com>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/4] perf map: fix overlapped map handling
On Sat, Sep 28, 2019 at 01:39:00AM +0000, Steve MacLean wrote:
SNIP
> Before:
>
> perf script --show-mmap-events 2>&1 | grep -e MMAP -e unknown |\
> grep libcoreclr.so | head -n 4
> dotnet 1907 373352.698780: PERF_RECORD_MMAP2 1907/1907: \
> [0x7fe615726000(0x768000) @ 0 08:02 5510620 765057155]: \
> r-xp .../3.0.0-preview9-19423-09/libcoreclr.so
> dotnet 1907 373352.701091: PERF_RECORD_MMAP2 1907/1907: \
> [0x7fe615974000(0x1000) @ 0x24e000 08:02 5510620 765057155]: \
> rwxp .../3.0.0-preview9-19423-09/libcoreclr.so
> dotnet 1907 373352.701241: PERF_RECORD_MMAP2 1907/1907: \
> [0x7fe615c42000(0x1000) @ 0x51c000 08:02 5510620 765057155]: \
> rwxp .../3.0.0-preview9-19423-09/libcoreclr.so
> dotnet 1907 373352.705249: 250000 cpu-clock: \
> 7fe6159a1f99 [unknown] \
> (.../3.0.0-preview9-19423-09/libcoreclr.so)
>
> After:
>
> perf script --show-mmap-events 2>&1 | grep -e MMAP -e unknown |\
> grep libcoreclr.so | head -n 4
> dotnet 1907 373352.698780: PERF_RECORD_MMAP2 1907/1907: \
> [0x7fe615726000(0x768000) @ 0 08:02 5510620 765057155]: \
> r-xp .../3.0.0-preview9-19423-09/libcoreclr.so
> dotnet 1907 373352.701091: PERF_RECORD_MMAP2 1907/1907: \
> [0x7fe615974000(0x1000) @ 0x24e000 08:02 5510620 765057155]: \
> rwxp .../3.0.0-preview9-19423-09/libcoreclr.so
> dotnet 1907 373352.701241: PERF_RECORD_MMAP2 1907/1907: \
> [0x7fe615c42000(0x1000) @ 0x51c000 08:02 5510620 765057155]: \
> rwxp .../3.0.0-preview9-19423-09/libcoreclr.so
>
> All the [unknown] symbols were resolved.
>
> Tested-by: Brian Robbins <brianrob@...rosoft.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Stephane Eranian <eranian@...gle.com>
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Steve MacLean <Steve.MacLean@...rosoft.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
thanks,
jirka
> ---
> tools/perf/util/map.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index 5b83ed1..eec9b28 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -1,5 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
> #include "symbol.h"
> +#include <assert.h>
> #include <errno.h>
> #include <inttypes.h>
> #include <limits.h>
> @@ -850,6 +851,8 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
> }
>
> after->start = map->end;
> + after->pgoff += map->end - pos->start;
> + assert(pos->map_ip(pos, map->end) == after->map_ip(after, map->end));
> __map_groups__insert(pos->groups, after);
> if (verbose >= 2 && !use_browser)
> map__fprintf(after, fp);
> --
> 2.7.4
Powered by blists - more mailing lists