Mercurial > hg > truffle
changeset 18947:7186feb0d971
Add Java and JVM arguments to log file when -G:LogFile= is used
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 26 Jan 2015 11:37:05 -0800 |
parents | 4ac00633d83c |
children | 568baf3550d3 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java Mon Jan 26 09:29:47 2015 -0800 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java Mon Jan 26 11:37:05 2015 -0800 @@ -81,6 +81,13 @@ try { final boolean enableAutoflush = true; ps = new PrintStream(new FileOutputStream(getFilename()), enableAutoflush); + /* Add the JVM and Java arguments to the log file to help identity it. */ + String inputArguments = String.join(" ", ManagementFactory.getRuntimeMXBean().getInputArguments()); + ps.println("VM Arguments: " + inputArguments); + String cmd = System.getProperty("sun.java.command"); + if (cmd != null) { + ps.println("sun.java.command=" + cmd); + } } catch (FileNotFoundException e) { throw new RuntimeException("couldn't open file: " + getValue(), e); }