Assembly code generation for JITWatch

63 views
Skip to first unread message

lukeg

unread,
Mar 28, 2017, 10:35:22 AM3/28/17
to JITWatch
Hi,

thanks for accepting me into the forum. JITWatch looks very promising as a tool to learn about intricacies of Java JIT. Unfortunately, I am not able to use it to its full potential as I don't know how to generate assembly code that can be picked up by JITWatch. This is the same question that I have already asked on StackOverflow (https://stackoverflow.com/questions/43066522/jitwatch-assembly-code-generation) and my problem is as follows:

However, JITWatch does not seem to see my assembly code and prints the following message in its windows: 

Assembly not found. Was -XX:+PrintAssembly option used?

I am using Oracle's JRE 1.8.0_121 on Windows 10 Home. I've added dissembly dll's to my JRE. The dll's were downloaded from FCML project. I can confirm that assembly is generated when I run program with java -XX:+UnlockDiagnosticVMOptions  -XX:+PrintAssembly test.Test options.

I've configured JITWatch paths so that *.java and *.class files are visible to it. For JITWatch analysis I run my Java program with java -XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading -XX:+LogCompilation -XX:+PrintAssembly test.Test and open the generated .log file with JITWatch. It can see the Java code and bytecode, but not the assembly. I suspect the problem is caused by the fact that assembly is printed to standard output (to the console) and not to log file. Is there an option I am missing?

Thanks for your answer.

Regards,
Łukasz

Chris Newland

unread,
Mar 28, 2017, 2:58:55 PM3/28/17
to JITWatch
Hi Łukasz,

Your command line switches look correct. I'm assuming your Test class runs hot enough to invoke the JIT?

I've not tried using the FCML disassembler so I'm not sure if the output is in a format that JITWatch recognises yet. I don't have access to a Windows 10 machine but will experiment with FCML and Windows 8.

Would it be possible for you to open an issue on https://github.com/AdoptOpenJDK/jitwatch/issues and upload your source and logfile as a Gist?

Many thanks,

Chris

Łukasz Górski

unread,
Mar 28, 2017, 3:34:23 PM3/28/17
to JITWatch
Hi,

thank you for your prompt reply. I will open an issue. It might be some dissasembler formatting problem, as now I've spotted following error on a console when opening the method for inspection:

21:29:30.098 [Thread-4] ERROR o.a.j.m.a.AssemblyProcessor - Could not determine architecture from '[Disassembling for mach='amd64']'

Regards,
Łukasz 

Chris Newland

unread,
Mar 29, 2017, 3:59:39 AM3/29/17
to JITWatch
Hi Łukasz,

Thanks for reporting. FCML uses a different mach identifier to hsdis so that was an easy fix: https://github.com/AdoptOpenJDK/jitwatch/commit/889c2464bf4c016ed1d9d1209f389f47381a99a3

Let me know if that works for you?

Cheers,

Chris

On Tuesday, 28 March 2017 15:35:22 UTC+1, Łukasz Górski wrote:

Łukasz Górski

unread,
Mar 29, 2017, 6:30:05 AM3/29/17
to JITWatch
Hi,

Thank you for prompt reaction. I confirm now everything works for me. Thanks!

Best regard,
Łukasz
Reply all
Reply to author
Forward
0 new messages