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 # valgrind_test.py | 6 # valgrind_test.py |
7 | 7 |
8 """Runs an exe through Valgrind and puts the intermediate files in a | 8 """Runs an exe through Valgrind and puts the intermediate files in a |
9 directory. | 9 directory. |
10 """ | 10 """ |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
726 | 726 |
727 def ToolCommand(self): | 727 def ToolCommand(self): |
728 """Get the tool command to run.""" | 728 """Get the tool command to run.""" |
729 tool_name = self.ToolName() | 729 tool_name = self.ToolName() |
730 | 730 |
731 # WINHEAP is what Dr. Memory supports as there are issues w/ both | 731 # WINHEAP is what Dr. Memory supports as there are issues w/ both |
732 # jemalloc (http://code.google.com/p/drmemory/issues/detail?id=320) and | 732 # jemalloc (http://code.google.com/p/drmemory/issues/detail?id=320) and |
733 # tcmalloc (http://code.google.com/p/drmemory/issues/detail?id=314) | 733 # tcmalloc (http://code.google.com/p/drmemory/issues/detail?id=314) |
734 add_env = { | 734 add_env = { |
735 "CHROME_ALLOCATOR" : "WINHEAP", | 735 "CHROME_ALLOCATOR" : "WINHEAP", |
736 "JSIMD_FORCEMMX" : "0", # http://code.google.com/p/drmemory/issues/deta il?id=540 | |
Derek Bruening
2011/08/04 14:54:27
shouldn't this be set to 1?
| |
736 } | 737 } |
737 for k,v in add_env.iteritems(): | 738 for k,v in add_env.iteritems(): |
738 logging.info("export %s=%s", k, v) | 739 logging.info("export %s=%s", k, v) |
739 os.putenv(k, v) | 740 os.putenv(k, v) |
740 | 741 |
741 drmem_cmd = os.getenv("DRMEMORY_COMMAND") | 742 drmem_cmd = os.getenv("DRMEMORY_COMMAND") |
742 if not drmem_cmd: | 743 if not drmem_cmd: |
743 raise RuntimeError, "Please set DRMEMORY_COMMAND environment variable " \ | 744 raise RuntimeError, "Please set DRMEMORY_COMMAND environment variable " \ |
744 "with the path to drmemory.exe" | 745 "with the path to drmemory.exe" |
745 proc = drmem_cmd.split(" ") | 746 proc = drmem_cmd.split(" ") |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
970 platform_name = sys.platform + "(Unknown)" | 971 platform_name = sys.platform + "(Unknown)" |
971 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 972 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
972 platform_name) | 973 platform_name) |
973 | 974 |
974 def CreateTool(tool): | 975 def CreateTool(tool): |
975 return ToolFactory().Create(tool) | 976 return ToolFactory().Create(tool) |
976 | 977 |
977 if __name__ == '__main__': | 978 if __name__ == '__main__': |
978 logging.error(sys.argv[0] + " can not be run from command line") | 979 logging.error(sys.argv[0] + " can not be run from command line") |
979 sys.exit(1) | 980 sys.exit(1) |
OLD | NEW |