| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # tsan_analyze.py | 6 # tsan_analyze.py |
| 7 | 7 |
| 8 ''' Given a ThreadSanitizer output file, parses errors and uniques them.''' | 8 ''' Given a ThreadSanitizer output file, parses errors and uniques them.''' |
| 9 | 9 |
| 10 import gdb_helper | 10 import gdb_helper |
| 11 | 11 |
| 12 import common |
| 12 import logging | 13 import logging |
| 13 import optparse | 14 import optparse |
| 14 import os | 15 import os |
| 15 import re | 16 import re |
| 16 import subprocess | 17 import subprocess |
| 17 import sys | 18 import sys |
| 18 import time | 19 import time |
| 19 | 20 |
| 20 # Global symbol table (ugh) | 21 # Global symbol table (ugh) |
| 21 TheAddressTable = None | 22 TheAddressTable = None |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (self.line_ == ''): | 117 if (self.line_ == ''): |
| 117 break | 118 break |
| 118 | 119 |
| 119 tmp = [] | 120 tmp = [] |
| 120 while re.search(TsanAnalyzer.THREAD_CREATION_STR, self.line_): | 121 while re.search(TsanAnalyzer.THREAD_CREATION_STR, self.line_): |
| 121 tmp.extend(self.ReadSection()) | 122 tmp.extend(self.ReadSection()) |
| 122 self.ReadLine() | 123 self.ReadLine() |
| 123 if re.search(TsanAnalyzer.TSAN_RACE_DESCRIPTION, self.line_): | 124 if re.search(TsanAnalyzer.TSAN_RACE_DESCRIPTION, self.line_): |
| 124 tmp.extend(self.ReadRaceSection()) | 125 tmp.extend(self.ReadRaceSection()) |
| 125 self.reports.append(tmp) | 126 self.reports.append(tmp) |
| 126 if re.search(TsanAnalyzer.TSAN_WARNING_DESCRIPTION, self.line_): | 127 if (re.search(TsanAnalyzer.TSAN_WARNING_DESCRIPTION, self.line_) and |
| 128 not common.IsWindows()): # workaround for http://crbug.com/53198 |
| 127 tmp.extend(self.ReadWarningSection()) | 129 tmp.extend(self.ReadWarningSection()) |
| 128 self.reports.append(tmp) | 130 self.reports.append(tmp) |
| 129 | 131 |
| 130 match = re.search(" used_suppression:\s+([0-9]+)\s(.*)", self.line_) | 132 match = re.search(" used_suppression:\s+([0-9]+)\s(.*)", self.line_) |
| 131 if match: | 133 if match: |
| 132 count, supp_name = match.groups() | 134 count, supp_name = match.groups() |
| 133 count = int(count) | 135 count = int(count) |
| 134 if supp_name in self.used_suppressions: | 136 if supp_name in self.used_suppressions: |
| 135 self.used_suppressions[supp_name] += count | 137 self.used_suppressions[supp_name] += count |
| 136 else: | 138 else: |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 200 |
| 199 (options, args) = parser.parse_args() | 201 (options, args) = parser.parse_args() |
| 200 if len(args) == 0: | 202 if len(args) == 0: |
| 201 parser.error("no filename specified") | 203 parser.error("no filename specified") |
| 202 filenames = args | 204 filenames = args |
| 203 | 205 |
| 204 analyzer = TsanAnalyzer(options.source_dir, use_gdb=True) | 206 analyzer = TsanAnalyzer(options.source_dir, use_gdb=True) |
| 205 retcode = analyzer.Report(filenames) | 207 retcode = analyzer.Report(filenames) |
| 206 | 208 |
| 207 sys.exit(retcode) | 209 sys.exit(retcode) |
| OLD | NEW |