summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-15 10:40:42 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-15 10:40:42 +0000
commit4b973d7a16cfee0fc0485f43b4ca68f3d76bacca (patch)
tree2460c69c63195d80afbf0b7b6d92e56431472494 /tools
parent4f32d9f4bdc7b556a6e88a2a0cd55a19d1d68fd1 (diff)
downloadchromium_src-4b973d7a16cfee0fc0485f43b4ca68f3d76bacca.zip
chromium_src-4b973d7a16cfee0fc0485f43b4ca68f3d76bacca.tar.gz
chromium_src-4b973d7a16cfee0fc0485f43b4ca68f3d76bacca.tar.bz2
Add default options for the RaceVerifier TSan mode.
Also, fix constructors for classes multiple inheritance. Commiting the patch for Evgeniy Stepanov, originally reviewed as http://codereview.chromium.org/3418008 TBR=glider TEST=memory waterfall should not be affected by this change Review URL: http://codereview.chromium.org/3418009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/valgrind/valgrind_test.py38
1 files changed, 25 insertions, 13 deletions
diff --git a/tools/valgrind/valgrind_test.py b/tools/valgrind/valgrind_test.py
index 75c52d4..d1ec87e 100755
--- a/tools/valgrind/valgrind_test.py
+++ b/tools/valgrind/valgrind_test.py
@@ -210,7 +210,7 @@ class ValgrindTool(BaseTool):
ExtendOptionParser() for tool-specific stuff.
"""
def __init__(self):
- BaseTool.__init__(self)
+ super(ValgrindTool, self).__init__()
self.RegisterOptionParserHook(ValgrindTool.ExtendOptionParser)
def UseXML(self):
@@ -471,7 +471,7 @@ class Memcheck(ValgrindTool):
"""
def __init__(self):
- ValgrindTool.__init__(self)
+ super(Memcheck, self).__init__()
self.RegisterOptionParserHook(Memcheck.ExtendOptionParser)
def ToolName(self):
@@ -518,9 +518,6 @@ class PinTool(BaseTool):
Always subclass this and implement ToolSpecificFlags() and
ExtendOptionParser() for tool-specific stuff.
"""
- def __init__(self):
- BaseTool.__init__(self)
-
def PrepareForTest(self):
pass
@@ -564,6 +561,7 @@ class ThreadSanitizerBase(object):
"ThreadSanitizer"
def __init__(self):
+ super(ThreadSanitizerBase, self).__init__()
self.RegisterOptionParserHook(ThreadSanitizerBase.ExtendOptionParser)
def ToolName(self):
@@ -641,10 +639,6 @@ class ThreadSanitizerBase(object):
return ret
class ThreadSanitizerPosix(ThreadSanitizerBase, ValgrindTool):
- def __init__(self):
- ValgrindTool.__init__(self)
- ThreadSanitizerBase.__init__(self)
-
def ToolSpecificFlags(self):
proc = ThreadSanitizerBase.ToolSpecificFlags(self)
# The -v flag is needed for printing the list of used suppressions and
@@ -664,9 +658,9 @@ class ThreadSanitizerPosix(ThreadSanitizerBase, ValgrindTool):
return ret
class ThreadSanitizerWindows(ThreadSanitizerBase, PinTool):
+
def __init__(self):
- PinTool.__init__(self)
- ThreadSanitizerBase.__init__(self)
+ super(ThreadSanitizerWindows, self).__init__()
self.RegisterOptionParserHook(ThreadSanitizerWindows.ExtendOptionParser)
def ExtendOptionParser(self, parser):
@@ -714,7 +708,7 @@ class DrMemory(BaseTool):
"""
def __init__(self):
- BaseTool.__init__(self)
+ super(DrMemory, self).__init__()
self.RegisterOptionParserHook(DrMemory.ExtendOptionParser)
def ToolName(self):
@@ -776,6 +770,13 @@ class DrMemory(BaseTool):
class ThreadSanitizerRV1Mixin(object):
"""First pass: run ThreadSanitizer as usual, but don't clean up logs"""
+ def __init__(self):
+ super(ThreadSanitizerRV1Mixin, self).__init__()
+ self.RegisterOptionParserHook(ThreadSanitizerRV1Mixin.ExtendOptionParser)
+
+ def ExtendOptionParser(self, parser):
+ parser.set_defaults(hybrid="yes")
+
def ParseArgv(self, args):
ret = super(ThreadSanitizerRV1Mixin, self).ParseArgv(args)
self._nocleanup_on_exit = True
@@ -784,9 +785,20 @@ class ThreadSanitizerRV1Mixin(object):
class ThreadSanitizerRV2Mixin(object):
"""Second pass: run the same command line in RaceVerifier mode"""
+ def __init__(self):
+ super(ThreadSanitizerRV2Mixin, self).__init__()
+ self.RegisterOptionParserHook(ThreadSanitizerRV2Mixin.ExtendOptionParser)
+
+ def ExtendOptionParser(self, parser):
+ parser.add_option("", "--race-verifier-sleep-ms",
+ dest="race_verifier_sleep_ms", default=10,
+ help="duration of RaceVerifier delays")
+
def ToolSpecificFlags(self):
proc = super(ThreadSanitizerRV2Mixin, self).ToolSpecificFlags()
- proc += ['--race-verifier=' + self.TMP_DIR + '/race.log']
+ proc += ['--race-verifier=' + self.TMP_DIR + '/race.log',
+ '--race-verifier-sleep-ms=%d' %
+ int(self._options.race_verifier_sleep_ms)]
return proc
class ThreadSanitizerRV1Posix(ThreadSanitizerRV1Mixin, ThreadSanitizerPosix):