Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: tools/callstats.py

Issue 2058003002: [tools] Fix Callstats-Group classifier regexp in callstats.py (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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: runtime-call-stats.py [-h] <command> ... 6 Usage: runtime-call-stats.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
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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 args.error("use either option --sites-file or site URLs") 629 args.error("use either option --sites-file or site URLs")
630 sys.exit(1) 630 sys.exit(1)
631 elif args.command == "run" and not coexist(args.replay_wpr, args.replay_bin): 631 elif args.command == "run" and not coexist(args.replay_wpr, args.replay_bin):
632 args.error("options --replay-wpr and --replay-bin must be used together") 632 args.error("options --replay-wpr and --replay-bin must be used together")
633 sys.exit(1) 633 sys.exit(1)
634 else: 634 else:
635 args.func(args) 635 args.func(args)
636 636
637 if __name__ == "__main__": 637 if __name__ == "__main__":
638 sys.exit(main()) 638 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698