# HG changeset patch # User Tom Rodriguez # Date 1422301025 28800 # Node ID 7186feb0d9714aa74adec3657decdc0b91c6ce3c # Parent 4ac00633d83c9cf409dcc6b0423c0a1c0618b280 Add Java and JVM arguments to log file when -G:LogFile= is used diff -r 4ac00633d83c -r 7186feb0d971 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java --- 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); }