All of lore.kernel.org
 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 3/4] perf inject --jit: Remove //anon mmap events
Date: Sun, 29 Sep 2019 17:29:25 +0200	[thread overview]
Message-ID: <20190929152721.GB16309@krava> (raw)
In-Reply-To: <BN8PR21MB13625F8AD3E9C67C0918A750F7800@BN8PR21MB1362.namprd21.prod.outlook.com>

On Sat, Sep 28, 2019 at 01:45:36AM +0000, Steve MacLean wrote:
> While a JIT is jitting code it will eventually need to commit more pages and
> change these pages to executable permissions.
> 
> Typically the JIT will want these co-located to minimize branch displacements.
> 
> The kernel will coalesce these anonymous mapping with identical permissions
> before sending an mmap event for the new pages. This means the mmap event for
> the new pages will include the older pages.
> 
> These anonymous mmap events will obscure the jitdump injected pseudo events.
> This means that the jitdump generated symbols, machine code, debugging info,
> and unwind info will no longer be used.
> 
> Observations:
> 
> When a process emits a jit dump marker and a jitdump file, the perf-xxx.map
> file represents inferior information which has been superseded by the
> jitdump jit-xxx.dump file.
> 
> Further the '//anon*' mmap events are only required for the legacy
> perf-xxx.map mapping.
> 
> Summary:
> 
> Add rbtree to track which pids have successfully injected a jitdump file.
> 
> During "perf inject --jit", discard "//anon*" mmap events for any pid which
> has successfully processed a jitdump file.
> 
> Committer testing:
> 
> // jitdump case
> perf record <app with jitdump>
> perf inject --jit --input perf.data --output perfjit.data
> 
> // verify mmap "//anon" events present initially
> perf script --input perf.data --show-mmap-events | grep '//anon'
> // verify mmap "//anon" events removed
> perf script --input perfjit.data --show-mmap-events | grep '//anon'
> 
> // no jitdump case
> perf record <app without jitdump>
> perf inject --jit --input perf.data --output perfjit.data
> 
> // verify mmap "//anon" events present initially
> perf script --input perf.data --show-mmap-events | grep '//anon'
> // verify mmap "//anon" events not removed
> perf script --input perfjit.data --show-mmap-events | grep '//anon'
> 
> Repro:
> 
> This issue was discovered while testing the initial CoreCLR jitdump
> implementation. https://github.com/dotnet/coreclr/pull/26897.

I can't apply this one:

patching file builtin-inject.c
Hunk #1 FAILED at 263.
1 out of 1 hunk FAILED -- saving rejects to file builtin-inject.c.rej
patching file util/jitdump.c
patch: **** malformed patch at line 236: btree, node);

jirka

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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28  1:45 [PATCH 3/4] perf inject --jit: Remove //anon mmap events Steve MacLean
2019-09-29 15:29 ` Jiri Olsa [this message]
2019-09-30 20:49   ` Steve MacLean
2019-10-01  2:20     ` Andi Kleen
2019-10-02 20:58 Steve MacLean
2019-10-03 10:57 ` Jiri Olsa
2019-10-30  3:10   ` Steve MacLean

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=20190929152721.GB16309@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.