Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: tools/valgrind/tsan_analyze.py

Issue 8702004: Refactor "Suppressions used" printing code in memcheck and tsan analyzer scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/valgrind/tsan/suppressions.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/valgrind/tsan_analyze.py
===================================================================
--- tools/valgrind/tsan_analyze.py (revision 111579)
+++ tools/valgrind/tsan_analyze.py (working copy)
@@ -9,7 +9,7 @@
import gdb_helper
-import common
+from collections import defaultdict
import hashlib
import logging
import optparse
@@ -19,6 +19,8 @@
import sys
import time
+import common
+
# Global symbol table (ugh)
TheAddressTable = None
@@ -48,7 +50,8 @@
THREAD_CREATION_STR = ("INFO: T.* "
"(has been created by T.* at this point|is program's main thread)")
- SANITY_TEST_SUPPRESSION = "ThreadSanitizer sanity test"
+ SANITY_TEST_SUPPRESSION = ("ThreadSanitizer sanity test "
+ "(ToolsSanityTest.DataRace)")
TSAN_RACE_DESCRIPTION = "Possible data race"
TSAN_WARNING_DESCRIPTION = ("Unlocking a non-locked lock"
"|accessing an invalid lock"
@@ -186,10 +189,7 @@
if match:
count, supp_name = match.groups()
count = int(count)
- if supp_name in self.used_suppressions:
- self.used_suppressions[supp_name] += count
- else:
- self.used_suppressions[supp_name] = count
+ self.used_suppressions[supp_name] += count
self.cur_fd_.close()
return ret
@@ -207,7 +207,7 @@
else:
TheAddressTable = None
reports = []
- self.used_suppressions = {}
+ self.used_suppressions = defaultdict(int)
for file in files:
reports.extend(self.ParseReportFile(file))
if self._use_gdb:
@@ -230,17 +230,9 @@
reports = self.GetReports(files)
self._cur_testcase = None # just in case, shouldn't be used anymore
- is_sane = False
- print "-----------------------------------------------------"
- print "Suppressions used:"
- print " count name"
- for item in sorted(self.used_suppressions.items(), key=lambda (k,v): (v,k)):
- print "%7s %s" % (item[1], item[0])
- if item[0].startswith(TsanAnalyzer.SANITY_TEST_SUPPRESSION):
- is_sane = True
- print "-----------------------------------------------------"
- sys.stdout.flush()
+ common.PrintUsedSuppressionsList(self.used_suppressions)
+
retcode = 0
if reports:
logging.error("FAIL! Found %i report(s)" % len(reports))
@@ -249,12 +241,14 @@
retcode = -1
# Report tool's insanity even if there were errors.
- if check_sanity and not is_sane:
+ if (check_sanity and
+ TsanAnalyzer.SANITY_TEST_SUPPRESSION not in self.used_suppressions):
logging.error("FAIL! Sanity check failed!")
retcode = -3
if retcode != 0:
return retcode
+
logging.info("PASS: No reports found")
return 0
« no previous file with comments | « tools/valgrind/tsan/suppressions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698