changeset 7547:f7ca24d268c4

changed format of files generated by CompilationStatistics to avoid spaces
author Doug Simon <doug.simon@oracle.com>
date Mon, 21 Jan 2013 17:09:31 +0100
parents 442668d41bc2
children a8b0476270cf
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java	Mon Jan 21 12:23:55 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java	Mon Jan 21 17:09:31 2013 +0100
@@ -36,9 +36,9 @@
 public final class CompilationStatistics {
 
     private static final long RESOLUTION = 100000000;
-    private static final boolean TIMELINE_ENABLED = System.getProperty("stats.timeline.file") != null;
+    private static final String TIMELINE_FILE = System.getProperty("stats.timeline.file");
     private static final boolean COMPILATIONSTATS_ENABLED = System.getProperty("stats.compilations.file") != null;
-    private static final boolean ENABLED = TIMELINE_ENABLED || COMPILATIONSTATS_ENABLED;
+    private static final boolean ENABLED = TIMELINE_FILE != null || COMPILATIONSTATS_ENABLED;
 
     private static final CompilationStatistics DUMMY = new CompilationStatistics(null);
 
@@ -133,8 +133,8 @@
             zeroTime = System.nanoTime();
 
             Date now = new Date();
-            String dateString = (now.getYear() + 1900) + "_" + (now.getMonth() + 1) + "_" + now.getDate() + " " + now.getHours() + "_" + now.getMinutes() + "_" + now.getSeconds();
-            try (PrintStream out = new PrintStream("compilations " + dateString + " " + dumpName + ".csv")) {
+            String dateString = (now.getYear() + 1900) + "-" + (now.getMonth() + 1) + "-" + now.getDate() + "-" + now.getHours() + "" + now.getMinutes();
+            try (PrintStream out = new PrintStream("compilations_" + dateString + "_" + dumpName + ".csv")) {
                 // output the list of all compilations
 
                 Field[] declaredFields = CompilationStatistics.class.getDeclaredFields();
@@ -164,11 +164,11 @@
                 }
             }
 
-            String timelineFile = System.getProperty("stats.timeline.file");
+            String timelineFile = TIMELINE_FILE;
             if (timelineFile == null || timelineFile.isEmpty()) {
-                timelineFile = "timeline " + dateString;
+                timelineFile = "timeline_" + dateString;
             }
-            try (FileOutputStream fos = new FileOutputStream(timelineFile + " " + dumpName + ".csv", true); PrintStream out = new PrintStream(fos)) {
+            try (FileOutputStream fos = new FileOutputStream(timelineFile + "_" + dumpName + ".csv", true); PrintStream out = new PrintStream(fos)) {
 
                 long[] timeSpent = new long[10000];
                 int maxTick = 0;