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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 'stddev': stddev, 'min': low, 'max': high, 'ci': ci } | 310 'stddev': stddev, 'min': low, 'max': high, 'ci': ci } |
311 | 311 |
312 | 312 |
313 def read_stats(path, domain, args): | 313 def read_stats(path, domain, args): |
314 groups = []; | 314 groups = []; |
315 if args.aggregate: | 315 if args.aggregate: |
316 groups = [ | 316 groups = [ |
317 ('Group-IC', re.compile(".*IC.*")), | 317 ('Group-IC', re.compile(".*IC.*")), |
318 ('Group-Optimize', | 318 ('Group-Optimize', |
319 re.compile("StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*")), | 319 re.compile("StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*")), |
320 ('Group-Compile', re.compile("Compile.*")), | 320 ('Group-Compile', re.compile(".*Compile.*")), |
321 ('Group-Parse', re.compile("Parse.*")), | 321 ('Group-Parse', re.compile(".*Parse.*")), |
322 ('Group-Callback', re.compile(".*Callback$")), | 322 ('Group-Callback', re.compile(".*Callback.*")), |
323 ('Group-API', re.compile("API.*")), | 323 ('Group-API', re.compile(".*API.*")), |
324 ('Group-GC', re.compile("GC|AllocateInTargetSpace")), | 324 ('Group-GC', re.compile("GC|AllocateInTargetSpace")), |
325 ('Group-JavaScript', re.compile("JS_Execution")), | 325 ('Group-JavaScript', re.compile("JS_Execution")), |
326 ('Group-Runtime', re.compile(".*"))] | 326 ('Group-Runtime', re.compile(".*"))] |
327 with open(path, "rt") as f: | 327 with open(path, "rt") as f: |
328 # Process the whole file and sum repeating entries. | 328 # Process the whole file and sum repeating entries. |
329 entries = { 'Sum': {'time': 0, 'count': 0} } | 329 entries = { 'Sum': {'time': 0, 'count': 0} } |
330 for group_name, regexp in groups: | 330 for group_name, regexp in groups: |
331 entries[group_name] = { 'time': 0, 'count': 0 } | 331 entries[group_name] = { 'time': 0, 'count': 0 } |
332 for line in f: | 332 for line in f: |
333 line = line.strip() | 333 line = line.strip() |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 args.error("use either option --sites-file or site URLs") | 636 args.error("use either option --sites-file or site URLs") |
637 sys.exit(1) | 637 sys.exit(1) |
638 elif args.command == "run" and not coexist(args.replay_wpr, args.replay_bin): | 638 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") | 639 args.error("options --replay-wpr and --replay-bin must be used together") |
640 sys.exit(1) | 640 sys.exit(1) |
641 else: | 641 else: |
642 args.func(args) | 642 args.func(args) |
643 | 643 |
644 if __name__ == "__main__": | 644 if __name__ == "__main__": |
645 sys.exit(main()) | 645 sys.exit(main()) |
OLD | NEW |