OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2016 The Chromium Authors. All rights reserved. | 3 # Copyright 2016 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 '''Implementation of tracing controller for systrace. This class creates the | 7 '''Implementation of tracing controller for systrace. This class creates the |
8 necessary tracing agents for systrace, runs them, and outputs the results | 8 necessary tracing agents for systrace, runs them, and outputs the results |
9 as an HTML or JSON file.''' | 9 as an HTML or JSON file.''' |
10 | 10 |
11 from systrace import output_generator | 11 from systrace import output_generator |
12 from systrace import tracing_controller | 12 from systrace import tracing_controller |
13 from systrace.tracing_agents import android_process_data_agent | 13 from systrace.tracing_agents import android_process_data_agent |
14 from systrace.tracing_agents import atrace_agent | 14 from systrace.tracing_agents import atrace_agent |
15 from systrace.tracing_agents import atrace_from_file_agent | 15 from systrace.tracing_agents import atrace_from_file_agent |
16 from systrace.tracing_agents import atrace_process_dump | 16 from systrace.tracing_agents import atrace_process_dump |
17 from systrace.tracing_agents import battor_trace_agent | 17 from systrace.tracing_agents import battor_trace_agent |
| 18 from systrace.tracing_agents import monsoon_agent |
18 from systrace.tracing_agents import ftrace_agent | 19 from systrace.tracing_agents import ftrace_agent |
19 from systrace.tracing_agents import walt_agent | 20 from systrace.tracing_agents import walt_agent |
20 | 21 |
21 AGENT_MODULES = [android_process_data_agent, atrace_agent, | 22 AGENT_MODULES = [android_process_data_agent, atrace_agent, |
22 atrace_from_file_agent, atrace_process_dump, | 23 atrace_from_file_agent, atrace_process_dump, |
23 battor_trace_agent, ftrace_agent, walt_agent] | 24 battor_trace_agent, ftrace_agent, walt_agent, |
| 25 monsoon_agent] |
24 | 26 |
25 class SystraceRunner(object): | 27 class SystraceRunner(object): |
26 def __init__(self, script_dir, options): | 28 def __init__(self, script_dir, options): |
27 """Constructor. | 29 """Constructor. |
28 | 30 |
29 Args: | 31 Args: |
30 script_dir: Directory containing the trace viewer script | 32 script_dir: Directory containing the trace viewer script |
31 (systrace_trace_viewer.html) | 33 (systrace_trace_viewer.html) |
32 options: Object containing command line options. | 34 options: Object containing command line options. |
33 """ | 35 """ |
(...skipping 28 matching lines...) Expand all Loading... |
62 if write_json: | 64 if write_json: |
63 result = output_generator.GenerateJSONOutput( | 65 result = output_generator.GenerateJSONOutput( |
64 self._tracing_controller.all_results, | 66 self._tracing_controller.all_results, |
65 self._out_filename) | 67 self._out_filename) |
66 else: | 68 else: |
67 result = output_generator.GenerateHTMLOutput( | 69 result = output_generator.GenerateHTMLOutput( |
68 self._tracing_controller.all_results, | 70 self._tracing_controller.all_results, |
69 self._out_filename) | 71 self._out_filename) |
70 print '\nWrote trace %s file: file://%s\n' % (('JSON' if write_json | 72 print '\nWrote trace %s file: file://%s\n' % (('JSON' if write_json |
71 else 'HTML'), result) | 73 else 'HTML'), result) |
OLD | NEW |