From 3aad6c406abb6535cf0af0d038b16f59dd1a82f3 Mon Sep 17 00:00:00 2001 From: jjenista Date: Thu, 18 Nov 2010 22:30:42 +0000 Subject: [PATCH] close this file so it actually writes out --- Robust/CoreProf/Trace.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Robust/CoreProf/Trace.java b/Robust/CoreProf/Trace.java index 7d9eefd8..0d4cf988 100644 --- a/Robust/CoreProf/Trace.java +++ b/Robust/CoreProf/Trace.java @@ -154,6 +154,12 @@ public class Trace { initNames(); + if( convert2txt ) { + try { + txtStream = new BufferedWriter( new FileWriter( "events.txt" ) ); + } catch( Exception e ) { e.printStackTrace(); System.exit( -1 ); } + } + if (convert2plot) { printPlotCmd(); } @@ -170,6 +176,12 @@ public class Trace { 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"); @@ -303,8 +315,6 @@ public class Trace { if( convert2txt ) { try { - txtStream = new BufferedWriter( new FileWriter( "events.txt" ) ); - txtStream.write( "\n\n\n\n" ); txtStream.write( "*************************************************\n" ); txtStream.write( "** Thread "+tNum+"\n" ); -- 2.34.1