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

Unified Diff: tools/valgrind/memcheck_analyze.py

Issue 7201026: Print suppression hashes for TSan reports (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « no previous file | tools/valgrind/tsan_analyze.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/valgrind/memcheck_analyze.py
===================================================================
--- tools/valgrind/memcheck_analyze.py (revision 89652)
+++ tools/valgrind/memcheck_analyze.py (working copy)
@@ -9,6 +9,7 @@
import gdb_helper
+import hashlib
import logging
import optparse
import os
@@ -254,8 +255,10 @@
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 @@
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 @@
# ... 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)
« no previous file with comments | « no previous file | tools/valgrind/tsan_analyze.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698