Index: tools/valgrind/memcheck_analyze.py |
=================================================================== |
--- tools/valgrind/memcheck_analyze.py (revision 89652) |
+++ tools/valgrind/memcheck_analyze.py (working copy) |
@@ -10,6 +10,7 @@ |
import gdb_helper |
import logging |
+import hashlib |
Alexander Potapenko
2011/06/20 14:57:04
Please fix the import order
Timur Iskhodzhanov
2011/06/20 15:04:51
Done.
|
import optparse |
import os |
import re |
@@ -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) |