Fix OOM checker in non-regression mode (NPOTB)
authorPaul Biggar <pbiggar@mozilla.com>
Sun, 03 Apr 2011 18:39:36 -0700
changeset 67911 f89b07ec09e2c9c35b21dee3b86412441b93808d
parent 67910 ee8f319bc315e04bfd44105328740bcb020c3f28
child 67912 43f70a7294fcf9184095286bd15e8bceca98a33b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix OOM checker in non-regression mode (NPOTB)
config/find_OOM_errors.py
js/src/config/find_OOM_errors.py
--- a/config/find_OOM_errors.py
+++ b/config/find_OOM_errors.py
@@ -65,17 +65,17 @@ def run(args, stdin=None):
     sys.exit(-1)
 
   stdout, stderr = stdout_worker.all, stderr_worker.all
   result = (stdout, stderr, proc.returncode)
   return result
 
 def get_js_files():
   (out, err, exit) = run('find ../jit-test/tests -name "*.js"')
-  if (err, exit) == ("", 0):
+  if (err, exit) != ("", 0):
     sys.exit("Wrong directory, run from an objdir")
   return out.split()
 
 
 
 #####################################################################
 # Blacklisting
 #####################################################################
@@ -186,35 +186,35 @@ whitelist.add(r"('', 'out of memory\nout
 
 #####################################################################
 # Program
 #####################################################################
 
 # Options
 parser = OptionParser(usage=usage)
 parser.add_option("-r", "--regression", action="store", metavar="REGRESSION_COUNT", help=help,
-                  type="int", dest="regression", default=0) # TODO: support a value of zero, eventually
+                  type="int", dest="regression", default=None)
                   
 (OPTIONS, args) = parser.parse_args()
 
 
-if OPTIONS.regression:
+if OPTIONS.regression != None:
   # TODO: This should be expanded as we get a better hang of the OOM problems.
   # For now, we'll just check that the number of OOMs in one short file does not
   # increase.
   files = ["../jit-test/tests/arguments/args-createontrace.js"]
 else:
   files = get_js_files()
 
   # Use a command-line arg to reduce the set of files
   if len (args):
     files = [f for f in files if f.find(args[0]) != -1]
 
 
-if OPTIONS.regression:
+if OPTIONS.regression == None:
   # Don't use a logfile, this is automated for tinderbox.
   log = file("../OOM_log", "w")
 
 
 num_failures = 0
 for f in files:
 
   # Run it once to establish boundaries
@@ -237,17 +237,17 @@ for f in files:
 
     # Success (5 is SM's exit code for controlled errors)
     if exit == 5 and err.find("out of memory") != -1:
       continue
 
     # Failure
     else:
 
-      if OPTIONS.regression:
+      if OPTIONS.regression != None:
         # Just count them
         num_failures += 1
         continue
 
       #########################################################################
       # The regression tests ends above. The rest of this is for running  the
       # script manually.
       #########################################################################
@@ -311,23 +311,23 @@ for f in files:
 
       log.write ("\n")
 
       log.write ("Valgrind info:\n" + vout)
       log.write ("\n")
       log.write ("\n")
       log.flush()
 
-  if not OPTIONS.regression == None:
+  if OPTIONS.regression == None:
     count_lines()
 
 print '\n',
 
 # Do the actual regression check
-if OPTIONS.regression:
+if OPTIONS.regression != None:
   expected_num_failures = OPTIONS.regression
 
   if num_failures != expected_num_failures:
 
     print "TEST-UNEXPECTED-FAIL |",
     if num_failures > expected_num_failures:
       print "More out-of-memory errors were found (%s) than expected (%d). This probably means an allocation site has been added without a NULL-check. If this is unavoidable, you can account for it by updating Makefile.in." % (num_failures, expected_num_failures),
     else:
--- a/js/src/config/find_OOM_errors.py
+++ b/js/src/config/find_OOM_errors.py
@@ -65,17 +65,17 @@ def run(args, stdin=None):
     sys.exit(-1)
 
   stdout, stderr = stdout_worker.all, stderr_worker.all
   result = (stdout, stderr, proc.returncode)
   return result
 
 def get_js_files():
   (out, err, exit) = run('find ../jit-test/tests -name "*.js"')
-  if (err, exit) == ("", 0):
+  if (err, exit) != ("", 0):
     sys.exit("Wrong directory, run from an objdir")
   return out.split()
 
 
 
 #####################################################################
 # Blacklisting
 #####################################################################
@@ -186,35 +186,35 @@ whitelist.add(r"('', 'out of memory\nout
 
 #####################################################################
 # Program
 #####################################################################
 
 # Options
 parser = OptionParser(usage=usage)
 parser.add_option("-r", "--regression", action="store", metavar="REGRESSION_COUNT", help=help,
-                  type="int", dest="regression", default=0) # TODO: support a value of zero, eventually
+                  type="int", dest="regression", default=None)
                   
 (OPTIONS, args) = parser.parse_args()
 
 
-if OPTIONS.regression:
+if OPTIONS.regression != None:
   # TODO: This should be expanded as we get a better hang of the OOM problems.
   # For now, we'll just check that the number of OOMs in one short file does not
   # increase.
   files = ["../jit-test/tests/arguments/args-createontrace.js"]
 else:
   files = get_js_files()
 
   # Use a command-line arg to reduce the set of files
   if len (args):
     files = [f for f in files if f.find(args[0]) != -1]
 
 
-if OPTIONS.regression:
+if OPTIONS.regression == None:
   # Don't use a logfile, this is automated for tinderbox.
   log = file("../OOM_log", "w")
 
 
 num_failures = 0
 for f in files:
 
   # Run it once to establish boundaries
@@ -237,17 +237,17 @@ for f in files:
 
     # Success (5 is SM's exit code for controlled errors)
     if exit == 5 and err.find("out of memory") != -1:
       continue
 
     # Failure
     else:
 
-      if OPTIONS.regression:
+      if OPTIONS.regression != None:
         # Just count them
         num_failures += 1
         continue
 
       #########################################################################
       # The regression tests ends above. The rest of this is for running  the
       # script manually.
       #########################################################################
@@ -311,23 +311,23 @@ for f in files:
 
       log.write ("\n")
 
       log.write ("Valgrind info:\n" + vout)
       log.write ("\n")
       log.write ("\n")
       log.flush()
 
-  if not OPTIONS.regression == None:
+  if OPTIONS.regression == None:
     count_lines()
 
 print '\n',
 
 # Do the actual regression check
-if OPTIONS.regression:
+if OPTIONS.regression != None:
   expected_num_failures = OPTIONS.regression
 
   if num_failures != expected_num_failures:
 
     print "TEST-UNEXPECTED-FAIL |",
     if num_failures > expected_num_failures:
       print "More out-of-memory errors were found (%s) than expected (%d). This probably means an allocation site has been added without a NULL-check. If this is unavoidable, you can account for it by updating Makefile.in." % (num_failures, expected_num_failures),
     else: