MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / main

Function main

tools/emprofile.py:71–107  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

69
70
71def main(args):
72 if '--help' in args:
73 print('''\
74Usage:
75 emprofile.py --clear (or -c)
76 Deletes all previously recorded profiling log files.
77 Use this to abort/drop any previously collected
78 profiling data for a new profiling run.
79
80 emprofile.py [--no-clear]
81 Draws a graph from all recorded profiling log files,
82 and deletes the recorded profiling files, unless
83 --no-clear is also passed.
84
85Optional parameters:
86
87 --outfile=x.html (or -o=x.html)
88 Specifies the name of the results file to generate.
89''')
90 return 0
91
92 if '--reset' in args or '--clear' in args or '-c' in args:
93 delete_profiler_logs()
94 return 0
95 else:
96 outfile = 'toolchain_profiler.results_' + time.strftime('%Y%m%d_%H%M')
97 for i, arg in enumerate(args):
98 if arg.startswith(('--outfile=', '-o=')):
99 outfile = arg.split('=', 1)[1].strip().replace('.html', '')
100 elif arg == '-o':
101 outfile = args[i + 1].strip().replace('.html', '')
102 if create_profiling_graph(outfile):
103 return 1
104 if '--no-clear' not in args:
105 delete_profiler_logs()
106
107 return 0
108
109
110if __name__ == '__main__':

Callers 1

emprofile.pyFile · 0.70

Calls 4

delete_profiler_logsFunction · 0.85
create_profiling_graphFunction · 0.85
splitMethod · 0.80
printFunction · 0.70

Tested by

no test coverage detected