diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 15:36:12 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 15:36:12 +0000 |
commit | a6bfb3f017b46b89e9df24fbcbbb9aaf264005b1 (patch) | |
tree | 3850fa335edd1310adf0383344f136e93db35042 /tools/heapcheck/heapcheck_test.py | |
parent | 3b99c5749f0670616a44bcf2af1897cac5f439eb (diff) | |
download | chromium_src-a6bfb3f017b46b89e9df24fbcbbb9aaf264005b1.zip chromium_src-a6bfb3f017b46b89e9df24fbcbbb9aaf264005b1.tar.gz chromium_src-a6bfb3f017b46b89e9df24fbcbbb9aaf264005b1.tar.bz2 |
Don't report duplicate stacks on heapchecker bots
BUG=none
TEST=no log parser errors on heapcheck bot
Review URL: http://codereview.chromium.org/6220004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71171 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/heapcheck/heapcheck_test.py')
-rw-r--r-- | tools/heapcheck/heapcheck_test.py | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/tools/heapcheck/heapcheck_test.py b/tools/heapcheck/heapcheck_test.py index 9c1165f..2e86e81 100644 --- a/tools/heapcheck/heapcheck_test.py +++ b/tools/heapcheck/heapcheck_test.py @@ -89,6 +89,7 @@ class HeapcheckWrapper(object): cur_leak_signature = None cur_stack = [] cur_report = [] + reported_hashes = {} # Statistics grouped by suppression description: # [hit count, bytes, objects]. used_suppressions = {} @@ -115,24 +116,26 @@ class HeapcheckWrapper(object): print ' ' + frame print 'Aborting...' return 3 - # Print the report and set the return code to 1. - print ('Leak of %d bytes in %d objects allocated from:' - % tuple(cur_leak_signature)) - print '\n'.join(cur_report) - return_code = 1 - # Generate the suppression iff the stack contains more than one - # frame (otherwise it's likely to be broken) - if len(cur_stack) > 1: - print '\nSuppression (error hash=#%016X#):\n{' \ - % (hash("".join(cur_stack)) & 0xffffffffffffffff) - print ' <insert_a_suppression_name_here>' - print ' Heapcheck:Leak' - for frame in cur_stack: - print ' fun:' + frame - print '}\n\n\n' - else: - print ('This stack may be broken due to omitted frame pointers. ' - 'It is not recommended to suppress it.') + error_hash = hash("".join(cur_stack)) & 0xffffffffffffffff + if error_hash not in reported_hashes: + reported_hashes[error_hash] = 1 + # Print the report and set the return code to 1. + print ('Leak of %d bytes in %d objects allocated from:' + % tuple(cur_leak_signature)) + print '\n'.join(cur_report) + return_code = 1 + # Generate the suppression iff the stack contains more than one + # frame (otherwise it's likely to be broken) + if len(cur_stack) > 1: + print '\nSuppression (error hash=#%016X#):\n{' % (error_hash) + print ' <insert_a_suppression_name_here>' + print ' Heapcheck:Leak' + for frame in cur_stack: + print ' fun:' + frame + print '}\n\n\n' + else: + print ('This stack may be broken due to omitted frame pointers.' + ' It is not recommended to suppress it.') else: # Update the suppressions histogram. if description in used_suppressions: |