Filtering the output of -XX:+PrintAssembly

Dennis Byrne dennisbyrne at apache.org
Tue Nov 17 08:24:29 PST 2009


The final paragraph of the hsdis README file [1] and second to last
paragraph of the wiki page [2] suggests that the following command
line only prints the assembly for the main method of my HelloWorld
class.

/usr/lib/jvm/java-6-openjdk/jre/bin/java
-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
-XX:PrintAssemblyOptions=hsdis-print-bytes -Xbatch
-XX:CompileCommand=print,*HelloWorld.main HelloWorld

However when I run this method, I get ~2000 lines of assembly.  How do
I filter for just the single main method?

[1] http://hg.openjdk.java.net/jdk7/hotspot/hotspot/file/2f1ec89b9995/src/share/tools/hsdis/README
[2] http://wikis.sun.com/display/HotSpotInternals/PrintAssembly

Any help would be greatly appreciated, thank you in advance.

-- 
Dennis Byrne


More information about the hotspot-dev mailing list