| OLD | NEW |
| 1 # Script for converting perf script events into tracing JSON. | 1 # Script for converting perf script events into tracing JSON. |
| 2 # | 2 # |
| 3 # Generated by perf script -g python | 3 # Generated by perf script -g python |
| 4 # Licensed under the terms of the GNU GPL License version 2 | 4 # Licensed under the terms of the GNU GPL License version 2 |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from collections import deque | 10 from collections import deque |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 'libchromeview.so': 'Chrome', | 44 'libchromeview.so': 'Chrome', |
| 45 '[unknown]': '<unknown>', | 45 '[unknown]': '<unknown>', |
| 46 '[UNKNOWN]': '<unknown>', | 46 '[UNKNOWN]': '<unknown>', |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 def FilterSymbolModule(module): | 50 def FilterSymbolModule(module): |
| 51 m = dso_to_comp.get(module, None) | 51 m = dso_to_comp.get(module, None) |
| 52 if m: | 52 if m: |
| 53 return m | 53 return m |
| 54 if module.find('libchrome.') == 0: | 54 if module.find('libchrome') == 0 or module.find('libcontent_shell') == 0: |
| 55 return 'Chrome' | 55 return 'Chrome' |
| 56 if module.find('dalvik') >= 0 or module.find('@') >= 0: | 56 if module.find('dalvik') >= 0 or module.find('@') >= 0: |
| 57 return 'Java' | 57 return 'Java' |
| 58 return module | 58 return module |
| 59 | 59 |
| 60 | 60 |
| 61 def FilterSymbolName(module, orign_module, name): | 61 def FilterSymbolName(module, orign_module, name): |
| 62 if module == 'Java': | 62 if module == 'Java': |
| 63 return name | 63 return name |
| 64 elif module == 'GPU Driver': | 64 elif module == 'GPU Driver': |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 FixCallTree(c, node) | 239 FixCallTree(c, node) |
| 240 | 240 |
| 241 FixCallTree(root_chain, None) | 241 FixCallTree(root_chain, None) |
| 242 | 242 |
| 243 trace_dict = {} | 243 trace_dict = {} |
| 244 trace_dict['samples'] = [s.ToDict() for s in samples] | 244 trace_dict['samples'] = [s.ToDict() for s in samples] |
| 245 trace_dict['stackFrames'] = root_chain.ToDict({}) | 245 trace_dict['stackFrames'] = root_chain.ToDict({}) |
| 246 trace_dict['traceEvents'] = [] | 246 trace_dict['traceEvents'] = [] |
| 247 | 247 |
| 248 json.dump(trace_dict, sys.stdout, indent=1) | 248 json.dump(trace_dict, sys.stdout, indent=1) |
| OLD | NEW |