summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-08-02 01:30:44 +0000
committerfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-08-02 01:30:44 +0000
commita23bc9aaac1b28ef80a02da871b69a19e444b037 (patch)
tree3d20a52e0b137a72c3e30f1993564f139fce5f72
parentcd08c48cbda7de21a90cee3ba3f2fda5d38addec (diff)
downloaddistcc-a23bc9aaac1b28ef80a02da871b69a19e444b037.tar.gz
Make the benchmarking script's stdout and stderr line buffered.
Reviewers: Craig Silverstein git-svn-id: http://distcc.googlecode.com/svn/trunk@589 01de4be4-8c4a-0410-9132-4925637da917
-rwxr-xr-xbench/benchmark.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bench/benchmark.py b/bench/benchmark.py
index 8b5ec38..5653e6a 100755
--- a/bench/benchmark.py
+++ b/bench/benchmark.py
@@ -149,6 +149,16 @@ The default is to measure a few reasonable scenarios.
######################################################################
def main():
"""Run the benchmark per arguments"""
+
+ # Ensure that stdout and stderr are line buffered, rather than
+ # block buffered, as might be the default when running with
+ # stdout/stderr redirected to a file; this ensures that the
+ # output is prompt, even when the script takes a long time for
+ # a single step, and it also avoids confusing intermingling of
+ # stdout and stderr.
+ sys.stdout = os.fdopen(1, "w", 1)
+ sys.stderr = os.fdopen(2, "w", 1)
+
sum = Summary()
options, args = getopt(sys.argv[1:], 'a:c:n:f:',
['list-projects', 'actions=', 'help', 'compiler=',