Anyway to hack JITTed code manually?
Krystal Mok
rednaxelafx at gmail.com
Tue May 12 06:49:36 UTC 2015
Hi Wei,
HotSpot VM is known to be able to work with other more native profiling
tools.
HotSpot can work with Linux perf. An easy way to run benchmarks and
profiling them is with the JMH framework and with the "perfasm" feature
[1][2].
Other profilers like Oracle Solaris Studio Performance Analyzer [3], Intel
VTune and AMD CodeAnalyst are also known to work with HotSpot.
- Kris
[1]: http://cr.openjdk.java.net/~shade/jmh/perfasm-sample.log
[2]: http://shipilev.net/blog/2014/java-scala-divided-we-fail/
[3]:
http://www.oracle.com/technetwork/server-storage/solarisstudio/features/performance-analyzer-2292312.html
On Mon, May 11, 2015 at 11:42 PM, Tangwei (Euler) <tangwei6 at huawei.com>
wrote:
> Hi Kris,
>
> Thanks for quick response. Is there any other hacking way in OpenJDK for
> fast performance measurement?
>
> Or is that possible to invoke other profiling tool such as “perf” instead
> of hprof in JVM to sampling more PMU events.
>
>
>
> Regards!
>
> wei
>
>
>
> *From:* Krystal Mok [mailto:rednaxelafx at gmail.com]
> *Sent:* Tuesday, May 12, 2015 2:34 PM
> *To:* Tangwei (Euler)
> *Cc:* hotspot-compiler-dev at openjdk.java.net
> *Subject:* Re: Anyway to hack JITTed code manually?
>
>
>
> Hi Wei,
>
>
>
> For HotSpot VM as it is now, the answer is no, there isn't a simple way to
> do that.
>
>
>
> One of the various problem that you'd have with trying to do something
> like this is relocation: there are a lot of addresses embedded into JIT
> compiled code as constants -- some could be Klass*, some could be compiled
> entry points to other compiled methods or stubs.
>
>
>
> The kind of feature you're asking for is more likely to be present in a VM
> that supports some certain form of AOT compilation, where the system has to
> deal with relocation of code anyway. The HotSpot VM we can see in OpenJDK
> doesn't do that right now.
>
>
>
> - Kris
>
>
>
> On Mon, May 11, 2015 at 11:24 PM, Tangwei (Euler) <tangwei6 at huawei.com>
> wrote:
>
> Hi All,
>
> Is there any simple way to hack JITTed code and relocate at runtime?
> Following steps are expected.
>
>
>
> 1. Dump JITTed code (c1/c2) to file or some cached directory.
>
> 2. Hack assembly code
>
> 3. Run JVM to load the hacked assembly code and relocating in memory
>
>
>
>
>
> Regards!
>
> wei
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150511/dbd8a203/attachment-0001.html>
More information about the hotspot-compiler-dev
mailing list