Commit bf42fc79 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Some find_problem updates

parent 382d5095
......@@ -22,9 +22,15 @@ def efficiency(rid):
return learnt/effort
if __name__ == "__main__":
if len(sys.argv) < 4:
print "Usage: python find_problem.py GOOD_REV BAD_REV make args"
print " (anything after BAD_REV gets passed as arguments to a 'make' invocation)"
sys.exit(1)
good_rev, bad_rev = sys.argv[1:3]
good_rev = int(good_rev)
bad_rev = int(bad_rev)
assert good_rev < bad_rev
args = sys.argv[3:]
assert args
......@@ -37,22 +43,30 @@ if __name__ == "__main__":
# b = test(bad_rev, args)
# assert not b, "bad_rev must not work"
f = open("find_problem.status", "w")
f.write("%d %d\n" % (good_rev, bad_rev))
f.flush()
while bad_rev > good_rev + 1:
print "%d is good, %d is bad" % (good_rev, bad_rev)
open("find_problem.status", "w").write("%d %d\n" % (good_rev, bad_rev))
middle = (good_rev + bad_rev + 1) / 2
revs = range(good_rev+1, middle+1)
revs.sort(reverse=True, key=efficiency)
# print good_rev, bad_rev, (good_rev + bad_rev) / 2, revs[0]
next_rev = revs[0]
print >>f, "Testing revision %d (p=%.1f%%)" % (next_rev, 100.0 * (next_rev - good_rev) / (bad_rev - good_rev))
f.flush()
print "Testing revision %d (p=%.1f%%)" % (next_rev, 100.0 * (next_rev - good_rev) / (bad_rev - good_rev))
b = test(next_rev, args)
print "Revision", next_rev, "works" if b else "failed"
print >>f, "Revision", next_rev, "works" if b else "failed"
f.flush()
if b:
good_rev = next_rev
else:
bad_rev = next_rev
open("find_problem.status", "w").write("%d %d\n" % (good_rev, bad_rev))
print "Rev %d is good, rev %d is bad" % (good_rev, bad_rev)
print >>f, "Rev %d is good, rev %d is bad" % (good_rev, bad_rev)
f.close()
......@@ -89,6 +89,8 @@ if __name__ == "__main__":
continue
if "support-varargs-intrinsics" in patch_fn and svn_rev >= 220205:
continue
if "Expose-getSymbolLoadAddress" in patch_fn and svn_rev <= 222840:
continue
patch_fn = os.path.abspath(os.path.join(patch_dir, patch_fn))
code = subprocess.call(["git", "am", patch_fn], cwd=repo)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment