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

Side by Side Diff: tools/valgrind/tsan_analyze.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/valgrind/tsan/PRESUBMIT.py ('k') | tools/valgrind/valgrind_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 TsanAnalyzer.SANITY_TEST_SUPPRESSION not in self.used_suppressions): 245 TsanAnalyzer.SANITY_TEST_SUPPRESSION not in self.used_suppressions):
246 logging.error("FAIL! Sanity check failed!") 246 logging.error("FAIL! Sanity check failed!")
247 retcode = -3 247 retcode = -3
248 248
249 if retcode != 0: 249 if retcode != 0:
250 return retcode 250 return retcode
251 251
252 logging.info("PASS: No reports found") 252 logging.info("PASS: No reports found")
253 return 0 253 return 0
254 254
255 if __name__ == '__main__': 255
256 def main():
256 '''For testing only. The TsanAnalyzer class should be imported instead.''' 257 '''For testing only. The TsanAnalyzer class should be imported instead.'''
257 retcode = 0
258 parser = optparse.OptionParser("usage: %prog [options] <files to analyze>") 258 parser = optparse.OptionParser("usage: %prog [options] <files to analyze>")
259 parser.add_option("", "--source_dir", 259 parser.add_option("", "--source_dir",
260 help="path to top of source tree for this build" 260 help="path to top of source tree for this build"
261 "(used to normalize source paths in baseline)") 261 "(used to normalize source paths in baseline)")
262 262
263 (options, args) = parser.parse_args() 263 (options, args) = parser.parse_args()
264 if not args: 264 if not args:
265 parser.error("no filename specified") 265 parser.error("no filename specified")
266 filenames = args 266 filenames = args
267 267
268 analyzer = TsanAnalyzer(options.source_dir, use_gdb=True) 268 analyzer = TsanAnalyzer(options.source_dir, use_gdb=True)
269 retcode = analyzer.Report(filenames, None) 269 return analyzer.Report(filenames, None)
270 270
271 sys.exit(retcode) 271
272 if __name__ == '__main__':
273 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/valgrind/tsan/PRESUBMIT.py ('k') | tools/valgrind/valgrind_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698