mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Steve MacLean <Steve.MacLean@microsoft.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Eric Saint-Etienne <eric.saint.etienne@oracle.com>,
	John Keeping <john@metanate.com>, Andi Kleen <ak@linux.intel.com>,
	Song Liu <songliubraving@fb.com>,
	Davidlohr Bueso <dave@stgolabs.net>, Leo Yan <leo.yan@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Brian Robbins <brianrob@microsoft.com>,
	Tom McDonald <Thomas.McDonald@microsoft.com>,
	John Salem <josalem@microsoft.com>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 1/4] perf map: fix overlapped map handling
Date: Sun, 29 Sep 2019 17:44:21 +0200	[thread overview]
Message-ID: <20190929154421.GA602@krava> (raw)
In-Reply-To: <BN8PR21MB136270949F22A6A02335C238F7800@BN8PR21MB1362.namprd21.prod.outlook.com>

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@microsoft.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Stephane Eranian <eranian@google.com>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Steve MacLean <Steve.MacLean@Microsoft.com>

Acked-by: Jiri Olsa <jolsa@kernel.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

      reply	other threads:[~2019-09-29 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28  1:39 Steve MacLean
2019-09-29 15:44 ` Jiri Olsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190929154421.GA602@krava \
    --to=jolsa@redhat.com \
    --cc=Steve.MacLean@microsoft.com \
    --cc=Thomas.McDonald@microsoft.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=brianrob@microsoft.com \
    --cc=dave@stgolabs.net \
    --cc=eranian@google.com \
    --cc=eric.saint.etienne@oracle.com \
    --cc=john@metanate.com \
    --cc=josalem@microsoft.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®