Bug 471950 Improve bloatdiff.pl error handling - improve tinderbox integration, and do not error when two logs have the same bloat data. r=nthomas,dbaron
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 17 Feb 2009 08:44:51 +0000
changeset 25055 e51cf7cb4f6397120e5f11c8e8ed3340607ca3e5
parent 25054 d2d0110cd69aee5da2404c021380b7c9652500b9
child 25056 ec53caefb5b869b39a4caf7eb85da2a7058f0946
push id5381
push userbugzilla@standard8.plus.com
push dateTue, 17 Feb 2009 08:46:21 +0000
treeherdermozilla-central@e51cf7cb4f63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnthomas, dbaron
bugs471950
milestone1.9.2a1pre
Bug 471950 Improve bloatdiff.pl error handling - improve tinderbox integration, and do not error when two logs have the same bloat data. r=nthomas,dbaron
tools/rb/bloatdiff.pl
--- a/tools/rb/bloatdiff.pl
+++ b/tools/rb/bloatdiff.pl
@@ -22,25 +22,25 @@ EOUSAGE
 
 $OLDFILE = $ARGV[0];
 $NEWFILE = $ARGV[1];
 #$LABEL   = $ARGV[2];
 
 if (!$OLDFILE or
     ! -e $OLDFILE or 
     -z $OLDFILE) {
-    print "\nERROR - Previous log file not specified, does not exist, or is empty.\n\n";
+    print "\nError: Previous log file not specified, does not exist, or is empty.\n\n";
     &usage();
     exit 1;
 }
 
 if (!$NEWFILE or
     ! -e $NEWFILE or 
     -z $NEWFILE) {
-    print "\nERROR - Current log file not specified, does not exist, or is empty.\n\n";
+    print "\nError: Current log file not specified, does not exist, or is empty.\n\n";
     &usage();
     exit 1;
 }
 
 sub processFile {
     my ($filename, $map, $prevMap) = @_;
     open(FH, $filename);
     while (<FH>) {
@@ -178,24 +178,26 @@ sub PrintSize($) {
 
 print "Bloat/Leak Delta Report\n";
 print "--------------------------------------------------------------------------------------\n";
 print "Current file:  $NEWFILE\n";
 print "Previous file: $OLDFILE\n";
 print "----------------------------------------------leaks------leaks%------bloat------bloat%\n";
 
     if (! $newMap{"TOTAL"} or 
-	! $newMap{"TOTAL"}{bloat} or 
-	! $newMap{"TOTAL"}{bloatPercent}) {
-        # it's OK if leaked or leakPercent are 0 (in fact, that would be good)
-	print "\nERROR - unable to calculate bloat/leak data.\n\n";
-	print "HINT - Did your test run complete successfully?\n";
-	print "HINT - Are you pointing at the right log files?\n\n";
-	&usage();
-	exit 1;
+        ! $newMap{"TOTAL"}{bloat}) {
+        # It's OK if leaked or leakPercent are 0 (in fact, that would be good).
+        # If bloatPercent is zero, it is also OK, because we may have just had
+        # two runs exactly the same or with no new bloat.
+        print "\nError: unable to calculate bloat/leak data.\n";
+        print "There is no data present.\n\n";
+        print "HINT - Did your test run complete successfully?\n";
+        print "HINT - Are you pointing at the right log files?\n\n";
+        &usage();
+        exit 1;
     }
 
 printf "%-40s %10s %10.2f%% %10s %10.2f%%\n",
        ("TOTAL",
         $newMap{"TOTAL"}{leaked}, $newMap{"TOTAL"}{leakPercent},
         $newMap{"TOTAL"}{bloat}, $newMap{"TOTAL"}{bloatPercent});
 
 ################################################################################