| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/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 import logging | 10 import logging |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 self.reports.append(self.line_.strip()) | 71 self.reports.append(self.line_.strip()) |
| 72 | 72 |
| 73 while True: | 73 while True: |
| 74 self.ReadLine(); | 74 self.ReadLine(); |
| 75 if (self.line_ == ''): break | 75 if (self.line_ == ''): break |
| 76 | 76 |
| 77 if re.search("SUPPRESSIONS USED:", self.line_): | 77 if re.search("SUPPRESSIONS USED:", self.line_): |
| 78 self.ReadLine() | 78 self.ReadLine() |
| 79 while self.line_.strip() != "": | 79 while self.line_.strip() != "": |
| 80 line = self.line_.strip() | 80 line = self.line_.strip() |
| 81 (count, name) = re.match(" *([0-9]+)x: (.*)", line).groups() | 81 (count, name) = re.match(" *([0-9]+)x(?: \(leaked .*\))?: (.*)", |
| 82 line).groups() |
| 82 self.used_suppressions.append("%7s %s" % (count, name)) | 83 self.used_suppressions.append("%7s %s" % (count, name)) |
| 83 self.ReadLine() | 84 self.ReadLine() |
| 84 break | 85 break |
| 85 | 86 |
| 86 self.cur_fd_.close() | 87 self.cur_fd_.close() |
| 87 | 88 |
| 88 def Report(self, check_sanity): | 89 def Report(self, check_sanity): |
| 89 sys.stdout.flush() | 90 sys.stdout.flush() |
| 90 #TODO(timurrrr): support positive tests / check_sanity==True | 91 #TODO(timurrrr): support positive tests / check_sanity==True |
| 91 | 92 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 120 | 121 |
| 121 (options, args) = parser.parse_args() | 122 (options, args) = parser.parse_args() |
| 122 if len(args) == 0: | 123 if len(args) == 0: |
| 123 parser.error("no filename specified") | 124 parser.error("no filename specified") |
| 124 filenames = args | 125 filenames = args |
| 125 | 126 |
| 126 analyzer = DrMemoryAnalyze(options.source_dir, filenames) | 127 analyzer = DrMemoryAnalyze(options.source_dir, filenames) |
| 127 retcode = analyzer.Report(False) | 128 retcode = analyzer.Report(False) |
| 128 | 129 |
| 129 sys.exit(retcode) | 130 sys.exit(retcode) |
| OLD | NEW |