summaryrefslogtreecommitdiffstats
path: root/tools/valgrind/memcheck_analyze.py
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 08:18:51 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 08:18:51 +0000
commit8de319076ff0432cba3c09e06c1b0ac05d321d8e (patch)
treedfdaf3546a716c0b14cf56d5be3d49e01251b86a /tools/valgrind/memcheck_analyze.py
parentbd6cdf26401dcf0b4cc4f89acfe0fc61724050cc (diff)
downloadchromium_src-8de319076ff0432cba3c09e06c1b0ac05d321d8e.zip
chromium_src-8de319076ff0432cba3c09e06c1b0ac05d321d8e.tar.gz
chromium_src-8de319076ff0432cba3c09e06c1b0ac05d321d8e.tar.bz2
Print suppression hashes for TSan reports
The buildbot should extract the suppression snippets, all the needed regexps are already there for Valgrind and HeapChecker bots. Also, make Memcheck hashes device-independent TEST=Run base_unittests --gtest_filter=*Sanity* without suppressions Review URL: http://codereview.chromium.org/7201026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/memcheck_analyze.py')
-rwxr-xr-xtools/valgrind/memcheck_analyze.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py
index f4a1322..177fd17 100755
--- a/tools/valgrind/memcheck_analyze.py
+++ b/tools/valgrind/memcheck_analyze.py
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -9,6 +9,7 @@
import gdb_helper
+import hashlib
import logging
import optparse
import os
@@ -254,8 +255,10 @@ class ValgrindError:
assert self._suppression != None, "Your Valgrind doesn't generate " \
"suppressions - is it too old?"
- output += "Suppression (error hash=#%016X#):" % \
- (self.__hash__() & 0xffffffffffffffff)
+ output += "Suppression (error hash=#%016X#):\n" % self.ErrorHash()
+ output += (" For more info on using suppressions see "
+ "http://dev.chromium.org/developers/how-tos/using-valgrind#TOC-Suppressing-Errors")
+
# Widen suppression slightly to make portable between mac and linux
supp = self._suppression;
supp = supp.replace("fun:_Znwj", "fun:_Znw*")
@@ -300,6 +303,12 @@ class ValgrindError:
return rep
+ # This is a device-independent hash identifying the suppression.
+ # By printing out this hash we can find duplicate reports between tests and
+ # different shards running on multiple buildbots
+ def ErrorHash(self):
+ return int(hashlib.md5(self.UniqueString()).hexdigest()[:16], 16)
+
def __hash__(self):
return hash(self.UniqueString())
def __eq__(self, rhs):
@@ -489,7 +498,7 @@ class MemcheckAnalyzer:
# ... but we saw it in earlier reports, e.g. previous UI test
cur_report_errors.add("This error was already printed in "
"some other test, see 'hash=#%016X#'" % \
- (error.__hash__() & 0xffffffffffffffff))
+ self.ErrorHash())
else:
# ... and we haven't seen it in other tests as well
self._errors.add(error)