OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 the V8 project authors. All rights reserved. | 2 # Copyright 2016 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 ''' | 5 ''' |
6 Usage: callstats.py [-h] <command> ... | 6 Usage: callstats.py [-h] <command> ... |
7 | 7 |
8 Optional arguments: | 8 Optional arguments: |
9 -h, --help show this help message and exit | 9 -h, --help show this help message and exit |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 user_data_dir = args.user_data_dir | 146 user_data_dir = args.user_data_dir |
147 else: | 147 else: |
148 user_data_dir = tempfile.mkdtemp(prefix="chr_") | 148 user_data_dir = tempfile.mkdtemp(prefix="chr_") |
149 js_flags = "--runtime-call-stats" | 149 js_flags = "--runtime-call-stats" |
150 if args.replay_wpr: js_flags += " --allow-natives-syntax" | 150 if args.replay_wpr: js_flags += " --allow-natives-syntax" |
151 if args.js_flags: js_flags += " " + args.js_flags | 151 if args.js_flags: js_flags += " " + args.js_flags |
152 chrome_flags = [ | 152 chrome_flags = [ |
153 "--no-default-browser-check", | 153 "--no-default-browser-check", |
154 "--no-sandbox", | 154 "--no-sandbox", |
155 "--disable-translate", | 155 "--disable-translate", |
| 156 "--enable-benchmarking", |
156 "--js-flags={}".format(js_flags), | 157 "--js-flags={}".format(js_flags), |
157 "--no-first-run", | 158 "--no-first-run", |
158 "--user-data-dir={}".format(user_data_dir), | 159 "--user-data-dir={}".format(user_data_dir), |
159 ] | 160 ] |
160 if args.replay_wpr: | 161 if args.replay_wpr: |
161 http_port = 4080 + args.port_offset | 162 http_port = 4080 + args.port_offset |
162 https_port = 4443 + args.port_offset | 163 https_port = 4443 + args.port_offset |
163 chrome_flags += [ | 164 chrome_flags += [ |
164 "--host-resolver-rules=MAP *:80 localhost:%s, " \ | 165 "--host-resolver-rules=MAP *:80 localhost:%s, " \ |
165 "MAP *:443 localhost:%s, " \ | 166 "MAP *:443 localhost:%s, " \ |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 args.error("use either option --sites-file or site URLs") | 637 args.error("use either option --sites-file or site URLs") |
637 sys.exit(1) | 638 sys.exit(1) |
638 elif args.command == "run" and not coexist(args.replay_wpr, args.replay_bin): | 639 elif args.command == "run" and not coexist(args.replay_wpr, args.replay_bin): |
639 args.error("options --replay-wpr and --replay-bin must be used together") | 640 args.error("options --replay-wpr and --replay-bin must be used together") |
640 sys.exit(1) | 641 sys.exit(1) |
641 else: | 642 else: |
642 args.func(args) | 643 args.func(args) |
643 | 644 |
644 if __name__ == "__main__": | 645 if __name__ == "__main__": |
645 sys.exit(main()) | 646 sys.exit(main()) |
OLD | NEW |