Chromium Code Reviews| Index: tools/callstats.py |
| diff --git a/tools/callstats.py b/tools/callstats.py |
| index fe9076f39b66f803315ae1b0266447d4e1d68854..971d22e8704fe5b0da5fcf14b8e55f443c71cf76 100755 |
| --- a/tools/callstats.py |
| +++ b/tools/callstats.py |
| @@ -46,7 +46,7 @@ def print_command(cmd_args): |
| print " ".join(map(fix_for_printing, cmd_args)) |
| -def start_replay_server(args, sites): |
| +def start_replay_server(args, sites, redirect_output=True): |
|
nickie
2016/09/28 15:00:32
nit: I'd rather call this discard_output.
Camillo Bruni
2016/09/29 08:54:09
fine with me :)
|
| with tempfile.NamedTemporaryFile(prefix='callstats-inject-', suffix='.js', |
| mode='wt', delete=False) as f: |
| injection = f.name |
| @@ -65,8 +65,11 @@ def start_replay_server(args, sites): |
| ] |
| print "=" * 80 |
| print_command(cmd_args) |
| - with open(os.devnull, 'w') as null: |
| - server = subprocess.Popen(cmd_args, stdout=null, stderr=null) |
| + if redirect_output: |
| + with open(os.devnull, 'w') as null: |
| + server = subprocess.Popen(cmd_args, stdout=null, stderr=null) |
| + else: |
| + server = subprocess.Popen(cmd_args) |
| print "RUNNING REPLAY SERVER: %s with PID=%s" % (args.replay_bin, server.pid) |
| print "=" * 80 |
| return {'process': server, 'injection': injection} |
| @@ -292,12 +295,12 @@ def do_run_replay_server(args): |
| print(" "+site['url']) |
| print("- " * 40) |
| print("Launch chromium with the following commands for debugging:") |
| - flags = get_chrome_flags("'--runtime-calls-stats --allow-natives-syntax'", |
| + flags = get_chrome_flags("'--runtime-call-stats --allow-natives-syntax'", |
| "/var/tmp/`date +%s`") |
| flags += get_chrome_replay_flags(args) |
| print(" $CHROMIUM_DIR/out/Release/chomium " + (" ".join(flags)) + " <URL>") |
| print("- " * 40) |
| - replay_server = start_replay_server(args, sites) |
| + replay_server = start_replay_server(args, sites, redirect_output=False) |
| try: |
| replay_server['process'].wait() |
| finally: |