summaryrefslogtreecommitdiffstats
path: root/tools/valgrind/memcheck_analyze.py
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-26 08:55:34 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-26 08:55:34 +0000
commitc5a49592b1cbe19e8866e31f4727dac2e5a8dd64 (patch)
treeddbdc4b42901a62d86e1cb27e83517024f17b255 /tools/valgrind/memcheck_analyze.py
parent85fbf86f01d4f237758ec083f152916fc680c41a (diff)
downloadchromium_src-c5a49592b1cbe19e8866e31f4727dac2e5a8dd64.zip
chromium_src-c5a49592b1cbe19e8866e31f4727dac2e5a8dd64.tar.gz
chromium_src-c5a49592b1cbe19e8866e31f4727dac2e5a8dd64.tar.bz2
Optimize memcheck_analyze.py for ui_tests
by using the same log completion waiting scheme as it was before rev47547. Before 47547: memcheck_analyze.Analyze was called once for all log files. That means, wait 3 minutes max in total for logs to complete. After 47547: memcheck_analyze.Analyze is called once for each ui_test. (better logs) That means, wait 3 minutes max for each ui_test and there are many of them. (SLOW!!!) After this patch: memcheck_analyze.Analyze is called once for each ui_test. (better logs) But since AnalyzeStartTime is now global, we wait 3 minutes max in total for logs to complete. TEST=Valgrind/UI bots should become faster Review URL: http://codereview.chromium.org/3035025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/memcheck_analyze.py')
-rwxr-xr-xtools/valgrind/memcheck_analyze.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py
index d1db465..7388de1 100755
--- a/tools/valgrind/memcheck_analyze.py
+++ b/tools/valgrind/memcheck_analyze.py
@@ -24,6 +24,15 @@ import common
# Global symbol table (yuck)
TheAddressTable = None
+# Contains the time when the we started analyzing the first log file.
+# This variable is used to skip incomplete logs after some timeout.
+# TODO(timurrrr): Currently, this needs to be a global variable
+# because analyzer can be called multiple times (e.g. ui_tests)
+# unless we re-factor the analyze system to avoid creating multiple analyzers.
+AnalyzeStartTime = None
+
+# Max time to wait for memcheck logs to complete.
+LOG_COMPLETION_TIMEOUT = 180.0
# These are functions (using C++ mangled names) that we look for in stack
# traces. We don't show stack frames while pretty printing when they are below
@@ -380,7 +389,10 @@ class MemcheckAnalyze:
self._errors = set()
self._suppcounts = {}
badfiles = set()
- start = time.time()
+
+ global AnalyzeStartTime
+ if AnalyzeStartTime == None:
+ AnalyzeStartTime = time.time()
self._parse_failed = False
for file in files:
# Wait up to three minutes for valgrind to finish writing all files,
@@ -394,7 +406,8 @@ class MemcheckAnalyze:
firstrun = True
origsize = os.path.getsize(file)
while (running and not found and
- (firstrun or ((time.time() - start) < 180.0))):
+ (firstrun or
+ ((time.time() - AnalyzeStartTime) < LOG_COMPLETION_TIMEOUT))):
firstrun = False
f.seek(0)
if pid: