Dumping graphs on the command line

Doug Simon doug.simon at oracle.com
Fri Jun 2 11:13:47 UTC 2017


Hi Alex,

Graphs will only be dumped for methods compiled by Graal. Most likely, your example is small enough that it never reaches the top tier compiler. To force a method to be compiled by Graal, you need to either make sure it's hot (e.g., by placing calls to it in a loop with many iterations) or use -XX:CompileOnly[1]. The former is usually a better approach since you'll get a compilation with a more realistic profile. To see what is being compiled by Graal, use either the -XX:+PrintCompilation or -Dgraal.PrintCompilation=true options (the latter shows C1 compilations as well). To restrict compilation only to Graal, use -XX:-TieredCompilation. As you're probably aware, you need -XX:+UseJVMCICompiler in all cases.

-Doug

[1] https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

> On 2 Jun 2017, at 12:45, Alexander Senier <alexander.senier at tu-dresden.de> wrote:
> 
> Hi all,
> 
> I'm looking into Graal to create data flow graphs from Java programs.
> Following the info from the repository I successfully got graphs in IGV
> from the unittests (Linux, version 0.23 from the website):
> 
> $ JAVA_HOME=../../labsjdk1.8.0_121-jvmci-0.26/ ../../mx/mx igv&
> $ PATH=/opt/graalvm-0.23/bin:$PATH
> JAVA_HOME=../../labsjdk1.8.0_121-jvmci-0.26/ ../../mx/mx unittest
> -Dgraal.Dump= -Dgraal.PrintCFG=true BC_aload
> 
> I see the graphs in IGV as well as the CFGPrinter log output.
> Subsequently, I tried to get the same graphs for a custom example:
> 
> $ /opt/graalvm-0.23/bin/javac  DH.java
> $ /opt/graalvm-0.23/bin/java -Dgraal.Dump= -Dgraal.PrintCFG=true
> -XX:+UseJVMCICompiler DH
> 
> While the program is compiled and run, no graphs are generated in IGV
> nor do I see any log files. I see no graal related messages either.
> 
> What is the canonical way to dump graphs from a compilation, preferably
> on the Linux command line?
> 
> Thanks!
> 
> Cheers,
> Alex
> 
> -- 
> Dipl.-Inf. Alexander Senier
> Scientific Assistant
> 
> TU Dresden
> Faculty of Computer Science
> Institute of System Architecture
> Chair of Privacy and Data Security
> 01062 Dresden
> 
> Tel.: +49 351 463-38719
> Fax : +49 351 463-38255



More information about the graal-dev mailing list