summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 16:34:25 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 16:34:25 +0000
commitc3e86a745c23deccefd4503075fd890d5737b57f (patch)
tree7423d610783507b4cb6250d85b6acb1285eeb077
parent7cb331a9b2dd452363f6611a757a838afd3439da (diff)
downloadchromium_src-c3e86a745c23deccefd4503075fd890d5737b57f.zip
chromium_src-c3e86a745c23deccefd4503075fd890d5737b57f.tar.gz
chromium_src-c3e86a745c23deccefd4503075fd890d5737b57f.tar.bz2
This CL adds the facility of providing Linux- and
Darwin-specific ignore files to ThreadSanitizer. This is necessary because ThreadSanitizer cannot handle the dSYM files properly and the "src:*" ignore rules don't work on Mac. The ignores_mac file contains the rules that make ThreadSanitizer ignore the false positives reported on base::subtle::{NoBarrier_Load, Release_Store} This patch was prepared by Alexander Potapenko (cc'ed) Review URL: http://codereview.chromium.org/251017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27365 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/valgrind/tsan/ignores_mac.txt9
-rwxr-xr-xtools/valgrind/valgrind_test.py17
2 files changed, 23 insertions, 3 deletions
diff --git a/tools/valgrind/tsan/ignores_mac.txt b/tools/valgrind/tsan/ignores_mac.txt
new file mode 100644
index 0000000..f502c3e
--- /dev/null
+++ b/tools/valgrind/tsan/ignores_mac.txt
@@ -0,0 +1,9 @@
+# This file lists the functions, object files and source files
+# which should be ignored (i.e. not instrumented) by ThreadSanitizer on Mac OS.
+# At the moment the Chromium binaries' debug info is not available to
+# ThreadSanitizer, so we have to define fun:* rules for Mac OS complementing
+# the src:* rules defined for Linux.
+
+# Don't instrument code dealing with atomics (base::subtle)
+fun:*base*subtle*NoBarrier_Load*
+fun:*base*subtle*Release_Store*
diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py
index b87c06b..0a23088 100755
--- a/tools/valgrind/valgrind_test.py
+++ b/tools/valgrind/valgrind_test.py
@@ -398,9 +398,20 @@ class ThreadSanitizer(ValgrindTool):
raise RuntimeError, "Can't parse flag value (%s)" % flag_value
def ToolSpecificFlags(self):
- ret = ["--ignore=%s" % \
- os.path.join(self._source_dir,
- "tools", "valgrind", "tsan", "ignores.txt")]
+ ret = []
+
+ ignore_files = ["ignores.txt"]
+ platform_suffix = {
+ 'darwin': 'mac',
+ 'linux2': 'linux'
+ }[sys.platform]
+ ignore_files.append("ignores_%s.txt" % platform_suffix)
+ for ignore_file in ignore_files:
+ fullname = os.path.join(self._source_dir,
+ "tools", "valgrind", "tsan", ignore_file)
+ if os.path.exists(fullname):
+ ret += ["--ignore=%s" % fullname]
+
ret += ["--file-prefix-to-cut=%s/" % self._source_dir]
if self.EvalBoolFlag(self._options.pure_happens_before):