public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Don Zickus <dzickus@redhat.com>
Cc: peterz@infradead.org, acme@redhat.com, jolsa@redhat.com,
	namhyung@kernel.org, linux-kernel@vger.kernel.org,
	eranian@google.com, andi@firstfloor.org, wcohen@redhat.com
Subject: Re: mapping instructions to dynamic languages like java, python, ruby
Date: Tue, 22 Apr 2014 22:54:39 +0200	[thread overview]
Message-ID: <20140422205439.GM22728@two.firstfloor.org> (raw)
In-Reply-To: <20140422180305.GK8488@redhat.com>

> Does anyone have any thoughts or experience on this?

perf has a JIT interface today, but it's extremely primitive
and only supports symbols. Clearly it could be done better.

Various JITs (e.g. Java) have special debug interfaces for this.

Various non perf profilers support it too. e.g. Vtune has a special
API for it:
https://software.intel.com/sites/default/files/jit_profiling_api_lin_0.pdf

Essentially you would need to write a JIT specific adapter 
that translates to perf format. Or emulate the Vtune interface
and reuse existing Vtune adaptations.

perf record needs some kind of side band interface where the JIT adapter
can report to it:
- symbols
- the assembler code (so it can be shown)
- source lines
- report any changes when JITed code changes

Then perf record could put that information into the perf.data.

In theory that information could be passed through the kernel,
but just using some user protocol (unix sockets or files) would be 
likely enough. The current interface uses files in /tmp.
I would likely change that, it's not clear even if it's secure.

It's likely a substantial project.

It would be even useful for the kernel, as the kernel does JITing 
itself these days.

-Andi

  parent reply	other threads:[~2014-04-22 20:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 18:03 mapping instructions to dynamic languages like java, python, ruby Don Zickus
2014-04-22 18:26 ` Peter Zijlstra
2014-04-22 19:05 ` Stephane Eranian
2014-04-22 19:19   ` David Ahern
2014-04-22 21:23   ` Don Zickus
2014-04-23  6:03   ` Namhyung Kim
2014-04-22 20:54 ` Andi Kleen [this message]
2014-04-22 21:24   ` 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=20140422205439.GM22728@two.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@redhat.com \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wcohen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox