diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 13:38:43 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 13:38:43 +0000 |
commit | f3e0ee5068b65b5828112558547c30aa7af521be (patch) | |
tree | 9b1b474baf8449a73f4654a9c50cb5bc891e7545 /tools/valgrind/test_suppressions.py | |
parent | 0ce492992e11845c55dd63115d2b3485fb1e414b (diff) | |
download | chromium_src-f3e0ee5068b65b5828112558547c30aa7af521be.zip chromium_src-f3e0ee5068b65b5828112558547c30aa7af521be.tar.gz chromium_src-f3e0ee5068b65b5828112558547c30aa7af521be.tar.bz2 |
Never create "negative" hashes and output the error hash along with the suppression.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3107005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/test_suppressions.py')
-rw-r--r-- | tools/valgrind/test_suppressions.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/valgrind/test_suppressions.py b/tools/valgrind/test_suppressions.py index 7473c9b..a0f64bf 100644 --- a/tools/valgrind/test_suppressions.py +++ b/tools/valgrind/test_suppressions.py @@ -13,10 +13,16 @@ import suppressions def ReadReportsFromFile(filename): + """ Returns a list of (report_hash, report) and the URL of the report on the + waterfall. + """ input_file = file(filename, 'r') + # reports is a list of (error hash, report) pairs. reports = [] in_suppression = False cur_supp = [] + # This stores the last error hash found while reading the file. + last_hash = "" for line in input_file: line = line.strip() line = line.replace("</span><span class=\"stdout\">", "") @@ -26,14 +32,22 @@ def ReadReportsFromFile(filename): if in_suppression: if line == "}": cur_supp += ["}"] - reports += ["\n".join(cur_supp)] + reports += [[last_hash, "\n".join(cur_supp)]] in_suppression = False cur_supp = [] + last_hash = "" else: cur_supp += [" "*3 + line] elif line == "{": in_suppression = True cur_supp = ["{"] + elif line.find("Suppression (error hash=#") == 0: + last_hash = line[25:33] + # Work around an (fixed) bug in memcheck_analyze.py. + # TODO(jochen): delete this after a couple of days. + if last_hash[0] == '-': + last_hash = line[26:34] + # The line at the end of the file is assumed to store the URL of the report. return reports,line suppressions_root = path_utils.ScriptDir() @@ -48,11 +62,13 @@ mac_suppressions = suppressions.ReadSuppressionsFromFile(supp_filename) # all_reports is a map {report: list of urls containing this report} all_reports = defaultdict(list) +report_hashes = {} for f in sys.argv[1:]: f_reports, url = ReadReportsFromFile(f) - for report in f_reports: + for (hash, report) in f_reports: all_reports[report] += [url] + report_hashes[report] = hash reports_count = 0 for r in all_reports: @@ -75,6 +91,7 @@ for r in all_reports: for url in all_reports[r]: print " %s" % url print "didn't match any suppressions:" + print "Suppression (error hash=#%s#):" % (report_hashes[r]) print r print "===================================" |