OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Runs an exe through Valgrind and puts the intermediate files in a | 5 """Runs an exe through Valgrind and puts the intermediate files in a |
6 directory. | 6 directory. |
7 """ | 7 """ |
8 | 8 |
9 import datetime | 9 import datetime |
10 import glob | 10 import glob |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 class ThreadSanitizerRV1Analyzer(tsan_analyze.TsanAnalyzer): | 959 class ThreadSanitizerRV1Analyzer(tsan_analyze.TsanAnalyzer): |
960 """ TsanAnalyzer that saves race reports to a file. """ | 960 """ TsanAnalyzer that saves race reports to a file. """ |
961 | 961 |
962 TMP_FILE = "rvlog.tmp" | 962 TMP_FILE = "rvlog.tmp" |
963 | 963 |
964 def __init__(self, source_dir, use_gdb): | 964 def __init__(self, source_dir, use_gdb): |
965 super(ThreadSanitizerRV1Analyzer, self).__init__(source_dir, use_gdb) | 965 super(ThreadSanitizerRV1Analyzer, self).__init__(source_dir, use_gdb) |
966 self.out = open(self.TMP_FILE, "w") | 966 self.out = open(self.TMP_FILE, "w") |
967 | 967 |
968 def Report(self, files, testcase, check_sanity=False): | 968 def Report(self, files, testcase, check_sanity=False): |
969 # TODO(timurrrr): handle testcase? | |
970 reports = self.GetReports(files) | 969 reports = self.GetReports(files) |
971 for report in reports: | 970 for report in reports: |
972 print >>self.out, report | 971 print >>self.out, report |
973 if len(reports) > 0: | 972 if len(reports) > 0: |
974 logging.info("RaceVerifier pass 1 of 2, found %i reports" % len(reports)) | 973 logging.info("RaceVerifier pass 1 of 2, found %i reports" % len(reports)) |
975 return -1 | 974 return -1 |
976 return 0 | 975 return 0 |
977 | 976 |
978 def CloseOutputFile(self): | 977 def CloseOutputFile(self): |
979 self.out.close() | 978 self.out.close() |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 return Asan() | 1197 return Asan() |
1199 try: | 1198 try: |
1200 platform_name = common.PlatformNames()[0] | 1199 platform_name = common.PlatformNames()[0] |
1201 except common.NotImplementedError: | 1200 except common.NotImplementedError: |
1202 platform_name = sys.platform + "(Unknown)" | 1201 platform_name = sys.platform + "(Unknown)" |
1203 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 1202 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
1204 platform_name) | 1203 platform_name) |
1205 | 1204 |
1206 def CreateTool(tool): | 1205 def CreateTool(tool): |
1207 return ToolFactory().Create(tool) | 1206 return ToolFactory().Create(tool) |
OLD | NEW |