Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotate a JITted method #7

Open
tdeneau opened this issue Oct 29, 2014 · 6 comments · May be fixed by #29
Open

annotate a JITted method #7

tdeneau opened this issue Oct 29, 2014 · 6 comments · May be fixed by #29

Comments

@tdeneau
Copy link

tdeneau commented Oct 29, 2014

Possible newbie question...

When I use the agent on a perf record command line and then run perf report, I do indeed see the JITted methods listed with event percentages, etc. But when I hit RETURN and try to drill down into a JITted method, no code is shown.

@jrudolph
Copy link
Member

jrudolph commented Nov 1, 2014

You are right that's currently not possible.

Last time I looked into it the perf-tools had a hard-coded way of disassembling binaries to do the annotations. It calls objdump <options> <library.so> with some parameters to create the disassembly and then annotates that. This obviously won't work for JITted methods which aren't persisted to disk.

I once had a hack in place where I provided an alternative objdump in the PATH which filters through the JVM's PrintAssembly output to provide drilling down into methods. However, the setup was very fragile so that I guess we'd need something better than that to make it actually work.

@jrudolph
Copy link
Member

jrudolph commented Dec 6, 2014

I've got a prototype of this working. This was quite a ride and will probably not be particularly portable but for me it works:

screenshot from 2014-12-06 11 30 43

Change upcoming after a bit of cleanup.

@tdeneau
Copy link
Author

tdeneau commented Dec 8, 2014

cool, will definitely give it a try when it is ready…

From: Johannes Rudolph [mailto:[email protected]]
Sent: Saturday, December 06, 2014 4:33 AM
To: jrudolph/perf-map-agent
Cc: Deneau, Tom
Subject: Re: [perf-map-agent] annotate a JITted method (#7)

I've got a prototype of this working. This was quite a ride and will probably not be particularly portable but for me it works:

[screenshot from 2014-12-06 11 30 43]https://cloud.githubusercontent.com/assets/9868/5327081/7519b70c-7d3b-11e4-802f-e0cae03ec8f3.png

Change upcoming after a bit of cleanup.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-65892461.

@tdeneau
Copy link
Author

tdeneau commented Jan 14, 2015

Hi Johannes --

I have not been following the perf-map-agent project for a little while but I notice now a lot of things changed in December 2014. Is it supposed to still be possible to use
perf record java -agentpath:libperfmap.so xxxx
and then use
perf report

Strangely even when I back up to the version before the December changes I cannot get this to work any longer.
But then my kernel and perf tools might have changed since it last worked, I noticed my perf version is 3.15.
(kernel is 3.17.0-0.1.fc22.aarch64)

-- Tom

From: Johannes Rudolph [mailto:[email protected]]
Sent: Saturday, December 06, 2014 4:33 AM
To: jrudolph/perf-map-agent
Cc: Deneau, Tom
Subject: Re: [perf-map-agent] annotate a JITted method (#7)

I've got a prototype of this working. This was quite a ride and will probably not be particularly portable but for me it works:

[screenshot from 2014-12-06 11 30 43]https://cloud.githubusercontent.com/assets/9868/5327081/7519b70c-7d3b-11e4-802f-e0cae03ec8f3.png

Change upcoming after a bit of cleanup.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-65892461.

@jrudolph
Copy link
Member

You don't need the -agentpath any more. Instead, there's now a small Java attach program which attaches the agent at runtime and report the current snapshot of JITted methods. See the perf-java script for how to use it.

@jrudolph
Copy link
Member

If you want to play with it: I pushed a branch to #29 which works for me but still sometimes crashes the JVM and sometimes also perf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants