[Swift-commit] r7543 - SwiftApps/heap-plot

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Sat Feb 1 20:51:24 CST 2014


Author: davidk
Date: 2014-02-01 20:51:24 -0600 (Sat, 01 Feb 2014)
New Revision: 7543

Added:
   SwiftApps/heap-plot/README
Modified:
   SwiftApps/heap-plot/heap-plot.pl
Log:
Fix x scale
Usage info


Added: SwiftApps/heap-plot/README
===================================================================
--- SwiftApps/heap-plot/README	                        (rev 0)
+++ SwiftApps/heap-plot/README	2014-02-02 02:51:24 UTC (rev 7543)
@@ -0,0 +1,3 @@
+Usage: $0 <swift.log>
+The output file generated will be named heap-plot.png.
+Requires gnuplot

Modified: SwiftApps/heap-plot/heap-plot.pl
===================================================================
--- SwiftApps/heap-plot/heap-plot.pl	2014-02-01 22:10:15 UTC (rev 7542)
+++ SwiftApps/heap-plot/heap-plot.pl	2014-02-02 02:51:24 UTC (rev 7543)
@@ -1,8 +1,13 @@
 #!/usr/bin/perl -w
 use strict;
-use Time::Local;
+use Time::Local 'timelocal_nocheck';
 
-# Usage: ./heapplot.pl run000.log
+# Usage: ./heap-plot.pl run000.log
+if(@ARGV != 1) {
+   print "Usage: $0 <swift.log>\n";
+   exit 1;
+}
+
 my $first_timestamp=0;
 
 # Read file
@@ -29,7 +34,7 @@
    $hhmmss = (split /,/, $hhmmss)[0];
    (my $year, my $month, my $monthday) = split('\-', $date);
    (my $hh, my $mm, my $ss) = split(':', $hhmmss);
-   my $time = timelocal($ss, $mm, $hh, $monthday-1, $month, $year);
+   my $time = timelocal_nocheck($ss, $mm, $hh, $monthday-1, $month, $year);
    return $time;
 }
 
@@ -74,9 +79,9 @@
 set ylabel "Size in MB"
 set autoscale x
 
-plot "heap-plot.dat" using 0:(\$2/1048576) with lines, \\
-                  '' using 0:(\$3/1048576) with lines, \\
-                  '' using 0:(\$4/1048576) with lines
+plot "heap-plot.dat" using 1:(\$2/1048576) with lines, \\
+                  '' using 1:(\$3/1048576) with lines, \\
+                  '' using 1:(\$4/1048576) with lines
 END
 
 print FILE $gp; 




More information about the Swift-commit mailing list