From: William Cohen <wcohen@redhat.com>
To: Carl Love <cel@us.ibm.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
"linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: Re: Perf support for interpreted and Just-In-Time translated olanguages
Date: Fri, 09 Jan 2015 23:15:19 -0500 [thread overview]
Message-ID: <54B0A757.2010407@redhat.com> (raw)
In-Reply-To: <1420834758.4897.10.camel@oc0276584878.ibm.com>
On 01/09/2015 03:19 PM, Carl Love wrote:
> Arnaldo:
>
>> I think this should be solved in the same way, i.e. content based keys,
>> that we call build-ids, every mapping, when put in place generates an
>> event, say PERF_RECORD_MMAP3, that comes with a key that can later be
>> used to retrieve the matching ELF file with DWARF info for annotation,
>> symbol resolution, unwinding, etc.
>>
>> Modern distros have this and that is why we store in the perf.data file
>> just the build ids, not the full ELF files at the time of the recording
>> session:
>
> I have been looking at and trying to code up some JIT support for perf.
> I have written a library to register the callbacks from a Java
> application. That is all fairly easy stuff.
>
> I have been trying to figure out how to get this library to communicate
> and send an event record to perf so perf can write it into perf.data, as
> you mentioned above. Specifically we will want to write the load and
> unload records to perf.data. The library gets loaded into the Java
> application but if you try loading the library in perf, they do not
> share the same data space so you can't pass the data directly.
>
> The only solution I see is creating a shared memory space where the
> library can place the event info. Then perf will have to connect to the
> shared memory space and "watch" for data to show up. This seems really
> awkward and slower then what we need. We need the notifications to be
> put into the perf.data file as close in time as possible to the event to
> ensure proper mapping of the addresses. It also means only one Java
> program can be using the interface at a time.
>
> I have thought about pipes, callbacks, but I don't see any way to get
> these to work between the library loaded in the Java program and perf.
> Just wondering if you had any thoughts on how to do the communication?
>
> Carl Love
Hi Carl,
Too bad there isn't a "sys_perf_event" syscall to allow user-space applications to inject like a software event style entries into the kernel's recording of perf events. The AMD lightweight profiling mechanism specified the LWPINS instruction to insert a software event entry into the data buffer (http://support.amd.com/TechDocs/43724.pdf). Seems like the linux kernel should have a similar mechanism to allow user and kernel-space to inject data in the perf records.
-Will
next prev parent reply other threads:[~2015-01-10 4:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 20:18 Perf support for interpreted and Just-In-Time translated languages Carl Love
2014-12-05 21:27 ` Brendan Gregg
2014-12-09 20:34 ` Arnaldo Carvalho de Melo
2014-12-09 22:01 ` Andi Kleen
2014-12-09 22:22 ` Perf support for interpreted and Just-In-Time translated olanguages Arnaldo Carvalho de Melo
2014-12-10 0:38 ` Andi Kleen
2014-12-10 17:41 ` Carl Love
2014-12-10 18:09 ` Andi Kleen
2014-12-10 19:21 ` Arnaldo Carvalho de Melo
2014-12-10 19:19 ` Arnaldo Carvalho de Melo
2014-12-10 17:32 ` Andi Kleen
2014-12-10 17:39 ` David Ahern
2014-12-10 18:05 ` Andi Kleen
2014-12-10 18:27 ` David Ahern
2014-12-10 19:43 ` Arnaldo Carvalho de Melo
2015-01-09 20:19 ` Carl Love
2015-01-10 4:15 ` William Cohen [this message]
2015-01-10 15:14 ` David Ahern
2015-01-12 17:22 ` Carl Love
2015-01-12 17:58 ` David Ahern
2015-01-12 18:43 ` Carl Love
2015-01-20 18:19 ` Carl Love
2015-01-20 19:29 ` Arnaldo Carvalho de Melo
2015-01-20 20:34 ` Carl Love
2015-01-20 20:52 ` Arnaldo Carvalho de Melo
2015-01-23 8:25 ` Sujoy Saraswati
2014-12-10 7:55 ` Perf support for interpreted and Just-In-Time translated languages Pekka Enberg
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=54B0A757.2010407@redhat.com \
--to=wcohen@redhat.com \
--cc=acme@kernel.org \
--cc=cel@us.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
/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.