All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Brian Robbins <brianrob@microsoft.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf: Fallback to JIT support for mmap'd non-ELF binaries.
Date: Fri, 20 Nov 2015 20:32:17 +0100	[thread overview]
Message-ID: <20151120193217.GW3816@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <SN1PR0301MB15982C2861CC002B4EAB1A47C81B0@SN1PR0301MB1598.namprd03.prod.outlook.com>

On Thu, Nov 19, 2015 at 11:45:45PM +0000, Brian Robbins wrote:

> Thank you for the feedback.  The file format is similar to PE, but is
> not identical.  So, we would be implementing something very scoped,
> which doesn't feel right to me.

*groan* you just had to go and invent yet another executable format,
right? :-)

> I am interested in the new JIT support, however my understanding from
> the information that I've read is that it requires kernel support in
> 4.x, though I can't seem to find where I read that.  I want to make
> sure that this works on older kernels (3.x) as well.

As I think Stephane explained, this is only required if you need to
match up kernel and userspace timestamps, which is important for dynamic
code generation, less so for static code in a weird format.

So what the new JIT stuff does is online write 'fake' ELF files with
symbol sections and (optionally?) dwarf debug info for line numbers.

Since you don't dynamically generate code, you can offline generate
these ELF files and redirect the symbol parser bits to that (we already
look for debug ELF files in various locations), or...

> The reason I went with this approach is because it is simple for
> runtimes to implement and has no requirement that perf understand the
> file format.  I am open to feedback if there is a preferred solution
> that would still work for older kernels as well.

Since, someone somewhere needs to go parse this funny new file format
anyhow to either generate /tmp files or fake ELF files or whatever, you
might as well put that decoder in perf?

Or just ship these fake ELF files in /usr/lib/debug/ or whatever the
'right' location for the distro at hand is.

  parent reply	other threads:[~2015-11-20 19:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 19:09 [PATCH] perf: Fallback to JIT support for mmap'd non-ELF binaries Brian Robbins
2015-11-19 19:31 ` Peter Zijlstra
2015-11-19 23:45   ` Brian Robbins
2015-11-20  0:09     ` Stephane Eranian
2015-11-20 18:36       ` Brian Robbins
2015-11-20 19:32     ` Peter Zijlstra [this message]
2015-11-20 21:18       ` Brian Robbins
2015-11-21 21:41         ` Arnaldo Carvalho de Melo
2015-11-23 17:36         ` Stephane Eranian

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=20151120193217.GW3816@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=brianrob@microsoft.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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.