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

Unified Diff: tools/valgrind/suppressions.py

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 months 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
Index: tools/valgrind/suppressions.py
diff --git a/tools/valgrind/suppressions.py b/tools/valgrind/suppressions.py
index c655e129689c7db14125953acbeac4df35a854ca..e066bedead15e70198e3b8676862c93df4315b68 100755
--- a/tools/valgrind/suppressions.py
+++ b/tools/valgrind/suppressions.py
@@ -45,25 +45,15 @@ def GetSuppressions():
supp_filename = JOIN(suppressions_root, "memcheck", "suppressions.txt")
vg_common = ReadSuppressionsFromFile(supp_filename)
- supp_filename = JOIN(suppressions_root, "tsan", "suppressions.txt")
- tsan_common = ReadSuppressionsFromFile(supp_filename)
- result['common_suppressions'] = vg_common + tsan_common
+ result['common_suppressions'] = vg_common
supp_filename = JOIN(suppressions_root, "memcheck", "suppressions_linux.txt")
vg_linux = ReadSuppressionsFromFile(supp_filename)
- supp_filename = JOIN(suppressions_root, "tsan", "suppressions_linux.txt")
- tsan_linux = ReadSuppressionsFromFile(supp_filename)
- result['linux_suppressions'] = vg_linux + tsan_linux
+ result['linux_suppressions'] = vg_linux
supp_filename = JOIN(suppressions_root, "memcheck", "suppressions_mac.txt")
vg_mac = ReadSuppressionsFromFile(supp_filename)
- supp_filename = JOIN(suppressions_root, "tsan", "suppressions_mac.txt")
- tsan_mac = ReadSuppressionsFromFile(supp_filename)
- result['mac_suppressions'] = vg_mac + tsan_mac
-
- supp_filename = JOIN(suppressions_root, "tsan", "suppressions_win32.txt")
- tsan_win = ReadSuppressionsFromFile(supp_filename)
- result['win_suppressions'] = tsan_win
+ result['mac_suppressions'] = vg_mac
supp_filename = JOIN(suppressions_root, "drmemory", "suppressions.txt")
result['drmem_suppressions'] = ReadSuppressionsFromFile(supp_filename)
@@ -147,7 +137,6 @@ def FilenameToTool(filename):
"""Return the name of the tool that a file is related to, or None.
Example mappings:
- tools/valgrind/tsan/suppressions.txt -> tsan
tools/valgrind/drmemory/suppressions.txt -> drmemory
tools/valgrind/drmemory/suppressions_full.txt -> drmemory
tools/valgrind/memcheck/suppressions.txt -> memcheck
@@ -156,7 +145,7 @@ def FilenameToTool(filename):
filename = os.path.abspath(filename)
parts = filename.split(os.sep)
tool = parts[-2]
- if tool in ('drmemory', 'memcheck', 'tsan'):
+ if tool in ('drmemory', 'memcheck'):
return tool
return None
@@ -166,7 +155,6 @@ def ReadSuppressionsFromFile(filename):
tool_to_parser = {
"drmemory": ReadDrMemorySuppressions,
"memcheck": ReadValgrindStyleSuppressions,
- "tsan": ReadValgrindStyleSuppressions,
}
tool = FilenameToTool(filename)
assert tool in tool_to_parser, (
@@ -188,15 +176,14 @@ def ReadSuppressionsFromFile(filename):
class ValgrindStyleSuppression(Suppression):
"""A suppression using the Valgrind syntax.
- Most tools, even ones that are not Valgrind-based, use this syntax, ie
- TSan, etc.
+ Most tools, even ones that are not Valgrind-based, use this syntax.
Attributes:
Same as Suppression.
"""
def __init__(self, description, type, stack, defined_at):
- """Creates a suppression using the Memcheck and TSan, syntax."""
+ """Creates a suppression using the Memcheck syntax."""
regex = '{\n.*\n%s\n' % type
for line in stack:
if line == ELLIPSIS:
@@ -296,17 +283,14 @@ def ReadValgrindStyleSuppressions(lines, supp_descriptor):
cur_descr = line
continue
elif not cur_type:
- if (not line.startswith("Memcheck:") and
- not line.startswith("ThreadSanitizer:")):
+ if not line.startswith("Memcheck:"):
raise SuppressionError(
- 'Expected "Memcheck:TYPE" or "ThreadSanitizer:TYPE", '
- 'got "%s"' % line,
+ 'Expected "Memcheck:TYPE", got "%s"' % line,
"%s:%d" % (supp_descriptor, nline))
supp_type = line.split(':')[1]
if not supp_type in ["Addr1", "Addr2", "Addr4", "Addr8",
"Cond", "Free", "Jump", "Leak", "Overlap", "Param",
"Value1", "Value2", "Value4", "Value8",
- "Race", "UnlockNonLocked", "InvalidLock",
"Unaddressable", "Uninitialized"]:
raise SuppressionError('Unknown suppression type "%s"' % supp_type,
"%s:%d" % (supp_descriptor, nline))
@@ -335,7 +319,6 @@ def PresubmitCheckSuppressions(supps):
if re.search("<.*suppression.name.here>", s.description):
# Suppression name line is
# <insert_a_suppression_name_here> for Memcheck,
- # <Put your suppression name here> for TSan,
# name=<insert_a_suppression_name_here> for DrMemory
errors.append(
SuppressionError(
@@ -365,9 +348,6 @@ def PresubmitCheck(input_api, output_api):
errors = []
- # TODO(timurrrr): warn on putting suppressions into a wrong file,
- # e.g. TSan suppression in a memcheck file.
-
for f in filenames:
try:
supps = ReadSuppressionsFromFile(f)
@@ -629,17 +609,6 @@ def SelfTest():
fun:expression
}"""
- test_tsan_stack = """{
- test
- ThreadSanitizer:Race
- fun:absolutly
- fun:brilliant
- obj:condition
- fun:detection
- fun:expression
- }"""
-
-
positive_memcheck_suppressions_1 = [
"{\nzzz\nMemcheck:Leak\nfun:absolutly\n}",
"{\nzzz\nMemcheck:Leak\nfun:ab*ly\n}",
@@ -680,11 +649,6 @@ def SelfTest():
"{\nzzz\nMemcheck:Addr4\n...\nfun:detection\n}",
]
- positive_tsan_suppressions = [
- "{\nzzz\nThreadSanitizer:Race\n...\nobj:condition\n}",
- "{\nzzz\nThreadSanitizer:Race\nfun:absolutly\n}",
- ]
-
negative_memcheck_suppressions_1 = [
"{\nzzz\nMemcheck:Leak\nfun:abnormal\n}",
"{\nzzz\nMemcheck:Leak\nfun:ab*liant\n}",
@@ -723,11 +687,6 @@ def SelfTest():
"{\nzzz\nMemcheck:Addr8\nfun:brilliant\n}",
]
- negative_tsan_suppressions = [
- "{\nzzz\nThreadSanitizer:Leak\nfun:absolutly\n}",
- "{\nzzz\nThreadSanitizer:Race\nfun:brilliant\n}",
- ]
-
TestStack(test_memcheck_stack_1,
positive_memcheck_suppressions_1,
negative_memcheck_suppressions_1)
@@ -740,8 +699,6 @@ def SelfTest():
TestStack(test_memcheck_stack_4,
positive_memcheck_suppressions_4,
negative_memcheck_suppressions_4)
- TestStack(test_tsan_stack, positive_tsan_suppressions,
- negative_tsan_suppressions)
# TODO(timurrrr): add TestFailPresubmit tests.
@@ -932,7 +889,6 @@ def SelfTest():
# Test FilenameToTool.
filenames_to_tools = {
- "tools/valgrind/tsan/suppressions.txt": "tsan",
"tools/valgrind/drmemory/suppressions.txt": "drmemory",
"tools/valgrind/drmemory/suppressions_full.txt": "drmemory",
"tools/valgrind/memcheck/suppressions.txt": "memcheck",
« no previous file with comments | « tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory_win32.txt ('k') | tools/valgrind/test_suppressions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698