AdoptOpenJDK / jitwatch

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.
Other
3.06k stars 437 forks source link

Assembly not found when VM flag is enabled #325

Closed LlamaLad7 closed 4 years ago

LlamaLad7 commented 4 years ago

VM Flags: -XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading -XX:+LogCompilation -XX:LogFile=D:\Documents\Programming\Java\jitwatch\sandbox\sandbox.log -XX:+PrintAssembly -XX:-BackgroundCompilation

sandbox.log

The hsdis DLL is definitely detected

chriswhocodes commented 4 years ago

Hi @LlamaLad7 I've built hsdis-amd64.dll on Windows 10 and copied it into zulu8/jre/bin/server/ (I use Azul's ZuluFX OpenJDK8 which includes JavaFX).

I've patched the disassembly search path to look in jre/bin/server and now it finds the hsdis binary and disassembly is working in JITWatch.

Please can you update to the latest code and try it (I also fixed the unit test that failed on Windows).

Thanks,

Chris

LlamaLad7 commented 4 years ago

Hi, Chris. As you said, the unit test no longer fails, and I can now build successfully. I am still, however, getting the "Assembly not found" issue. Tomorrow I'll try building the dll again, and see if that helps anything. If you need anymore info / logs then let me know.

Thanks,

Llama

chriswhocodes commented 4 years ago

Hi, sorry I should have checked this earlier, I just spotted this in your sandbox log: Could not load hsdis-amd64.dll; library not loadable; PrintAssembly is disabled and there is no assembly in the log.

Can you tell me what happens when you run

java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly

Do you see assembly output to your console (you should if your hsdis is set up correctly) ?

According to the log file your VM is

java.vm.version=25.172-b11
java.vm.name=Java HotSpot(TM) 64-Bit Server VM

To get hsdis working on 64-bit Java8 I used the instructions here https://dropzone.nfshost.com/hsdis/ and followed them exactly, putting the DLL in zulu8/jre/bin/server/

Thanks,

Chris

LlamaLad7 commented 4 years ago

Ah it appears I had the DLL in the wrong directory. Moving it to jdk/jre/bin/server has fixed the issue. Thanks!