close this file so it actually writes out
authorjjenista <jjenista>
Thu, 18 Nov 2010 22:30:42 +0000 (22:30 +0000)
committerjjenista <jjenista>
Thu, 18 Nov 2010 22:30:42 +0000 (22:30 +0000)
Robust/CoreProf/Trace.java

index 7d9eefd892d32411220671b4b943d58276cb9ae6..0d4cf9882de653377706b29b410fdea7bc8fba63 100644 (file)
@@ -154,6 +154,12 @@ public class Trace {
 
     initNames();
 
 
     initNames();
 
+    if( convert2txt ) {
+      try { 
+        txtStream = new BufferedWriter( new FileWriter( "events.txt" ) ); 
+      } catch( Exception e ) { e.printStackTrace(); System.exit( -1 ); }
+    }
+
     if (convert2plot) {
       printPlotCmd();
     }
     if (convert2plot) {
       printPlotCmd();
     }
@@ -170,6 +176,12 @@ public class Trace {
 
     printStats( outFile );
 
 
     printStats( outFile );
 
+    if( convert2txt ) {
+      try {
+        txtStream.close();
+      } catch( Exception e ) { e.printStackTrace(); System.exit( -1 ); }
+    }
+
     if( convert2plot ) {
       try {
        bwPlot.write("plot [0:"+(globendtime/scale)+"] [-1:"+(numThreads+1)+"] -3\n");
     if( convert2plot ) {
       try {
        bwPlot.write("plot [0:"+(globendtime/scale)+"] [-1:"+(numThreads+1)+"] -3\n");
@@ -303,8 +315,6 @@ public class Trace {
 
     if( convert2txt ) {
       try {
 
     if( convert2txt ) {
       try {
-        txtStream = new BufferedWriter( new FileWriter( "events.txt" ) );
-
         txtStream.write( "\n\n\n\n" );
         txtStream.write( "*************************************************\n" );
         txtStream.write( "**  Thread "+tNum+"\n" );
         txtStream.write( "\n\n\n\n" );
         txtStream.write( "*************************************************\n" );
         txtStream.write( "**  Thread "+tNum+"\n" );