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

Side by Side Diff: tools/valgrind/drmemory_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/common.py ('k') | tools/valgrind/gdb_helper.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 # drmemory_analyze.py 6 # drmemory_analyze.py
7 7
8 ''' Given a Dr. Memory output file, parses errors and uniques them.''' 8 ''' Given a Dr. Memory output file, parses errors and uniques them.'''
9 9
10 from collections import defaultdict 10 from collections import defaultdict
11 import common 11 import common
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 logging.error("Found %i error reports" % len(to_report)) 92 logging.error("Found %i error reports" % len(to_report))
93 for report in to_report: 93 for report in to_report:
94 if testcase: 94 if testcase:
95 logging.error("\n%s\nNote: observed on `%s`\n" % 95 logging.error("\n%s\nNote: observed on `%s`\n" %
96 (report, testcase)) 96 (report, testcase))
97 else: 97 else:
98 logging.error("\n%s\n" % report) 98 logging.error("\n%s\n" % report)
99 logging.error("Total: %i error reports" % len(to_report)) 99 logging.error("Total: %i error reports" % len(to_report))
100 return -1 100 return -1
101 101
102 if __name__ == '__main__': 102
103 '''For testing only. The DrMemoryAnalyzer class should be imported instead.''' 103 def main():
104 retcode = 0 104 '''For testing only. The DrMemoryAnalyze class should be imported instead.'''
105 parser = optparse.OptionParser("usage: %prog <files to analyze>") 105 parser = optparse.OptionParser("usage: %prog [options] <files to analyze>")
106 parser.add_option("", "--source_dir",
107 help="path to top of source tree for this build"
108 "(used to normalize source paths in baseline)")
109
106 (options, args) = parser.parse_args() 110 (options, args) = parser.parse_args()
107 if len(args) == 0: 111 if len(args) == 0:
108 parser.error("no filename specified") 112 parser.error("no filename specified")
109 filenames = args 113 filenames = args
110 114
111 analyzer = DrMemoryAnalyzer() 115 return DrMemoryAnalyzer().Report(filenames, None, False)
112 retcode = analyzer.Report(filenames, None, False)
113 116
114 sys.exit(retcode) 117
118 if __name__ == '__main__':
119 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/valgrind/common.py ('k') | tools/valgrind/gdb_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698