diff options
author | Michael Adler <Michael.Adler@intel.com> | 2008-07-23 14:41:34 -0700 |
---|---|---|
committer | Michael Adler <Michael.Adler@intel.com> | 2008-07-23 14:41:34 -0700 |
commit | 5f42bfcd56c84f6fe938b88411265359fc702110 (patch) | |
tree | a075741ec0d18af15c7a4b1c4aef23091706b4f8 /configs | |
parent | 2cd04fd6da67d874fd4e563ed05707a42ff0598f (diff) | |
download | gem5-5f42bfcd56c84f6fe938b88411265359fc702110.tar.xz |
process: separate stderr from stdout
- Add the option of redirecting stderr to a file. With the old
behaviour, stderr would follow stdout if stdout was to a file, but
stderr went to the host stderr if stdout went to the host stdout. The
new default maintains stdout and stderr going to the host. Now the
two can specify different files, but they will share a file descriptor
if the name of the files is the same.
- Add --output and --errout options to se.py to go with --input.
Diffstat (limited to 'configs')
-rw-r--r-- | configs/example/se.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/configs/example/se.py b/configs/example/se.py index fa7959b99..a2172aeb5 100644 --- a/configs/example/se.py +++ b/configs/example/se.py @@ -37,6 +37,7 @@ if m5.build_env['FULL_SYSTEM']: from m5.objects import * import os, optparse, sys +from os.path import join as joinpath m5.AddToPath('../common') import Simulation from Caches import * @@ -51,13 +52,13 @@ parser = optparse.OptionParser() # Benchmark options parser.add_option("-c", "--cmd", - default=os.path.join(m5_root, "tests/test-progs/hello/bin/alpha/linux/hello"), - help="The binary to run in syscall emulation mode.") + default=joinpath(m5_root, "tests/test-progs/hello/bin/alpha/linux/hello"), + help="The binary to run in syscall emulation mode.") parser.add_option("-o", "--options", default="", - help="The options to pass to the binary, use \" \" around the entire\ - string.") -parser.add_option("-i", "--input", default="", - help="A file of input to give to the binary.") + help='The options to pass to the binary, use " " around the entire string') +parser.add_option("-i", "--input", default="", help="Read stdin from a file.") +parser.add_option("--output", default="", help="Redirect stdout to a file.") +parser.add_option("--errout", default="", help="Redirect stderr to a file.") execfile(os.path.join(config_root, "common", "Options.py")) @@ -85,6 +86,10 @@ else: if options.input != "": process.input = options.input +if options.output != "": + process.output = options.output +if options.errout != "": + process.errout = options.errout if options.detailed: #check for SMT workload @@ -93,9 +98,15 @@ if options.detailed: process = [] smt_idx = 0 inputs = [] + outputs = [] + errouts = [] if options.input != "": inputs = options.input.split(';') + if options.output != "": + outputs = options.output.split(';') + if options.errout != "": + errouts = options.errout.split(';') for wrkld in workloads: smt_process = LiveProcess() @@ -103,6 +114,10 @@ if options.detailed: smt_process.cmd = wrkld + " " + options.options if inputs and inputs[smt_idx]: smt_process.input = inputs[smt_idx] + if outputs and outputs[smt_idx]: + smt_process.output = outputs[smt_idx] + if errouts and errouts[smt_idx]: + smt_process.errout = errouts[smt_idx] process += [smt_process, ] smt_idx += 1 |