diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-08-05 22:45:32 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-08-05 22:45:32 +0000 |
commit | a5e4f4d2969520f4563ec0d66cbe469c49ee38bc (patch) | |
tree | 8a0d6fd78eb610653f12ded770595c80f1e89a61 /catapult/systrace/systrace/output_generator.py | |
parent | 5e1447373f2b6aaefa0e866c5907a291e7071a3d (diff) | |
parent | 5338649baa46daab43dd19d939fc1f016d400a94 (diff) | |
download | chromium-trace-a5e4f4d2969520f4563ec0d66cbe469c49ee38bc.tar.gz |
Merge changes Ie9f01eed,I3acb8a0d am: fb769a1607 am: 316160b179 am: 3fd616f492 am: 5338649baa
Original change: https://android-review.googlesource.com/c/platform/external/chromium-trace/+/1392438
Change-Id: I01f6e9f32cc3210fbc5f6f645a77b74316ecfb3b
Diffstat (limited to 'catapult/systrace/systrace/output_generator.py')
-rw-r--r-- | catapult/systrace/systrace/output_generator.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/catapult/systrace/systrace/output_generator.py b/catapult/systrace/systrace/output_generator.py index b1dc2759..40bfe209 100644 --- a/catapult/systrace/systrace/output_generator.py +++ b/catapult/systrace/systrace/output_generator.py @@ -28,6 +28,7 @@ _SYSTRACE_TO_TRACE_DATA_NAME_MAPPING = { 'systraceController': trace_data.TELEMETRY_PART, 'traceEvents': trace_data.CHROME_TRACE_PART, 'waltTrace': trace_data.WALT_TRACE_PART, + 'cgroupDump': trace_data.CGROUP_TRACE_PART, } _SYSTRACE_HEADER = 'Systrace' @@ -61,7 +62,7 @@ def GenerateHTMLOutput(trace_results, output_file_name): # Java verison of systrace. Java systrace is expected to be deleted at a later # date. We should consolidate this logic when that happens. - if len(trace_results) > 3: + if len(trace_results) > 4: NewGenerateHTMLOutput(trace_results, output_file_name) return os.path.abspath(output_file_name) @@ -79,17 +80,28 @@ def GenerateHTMLOutput(trace_results, output_file_name): # Open the file in binary mode to prevent python from changing the # line endings, then write the prefix. systrace_dir = os.path.abspath(os.path.dirname(__file__)) - html_prefix = _ReadAsset(systrace_dir, 'prefix.html') + html_prefix = _ReadAsset(systrace_dir, 'prefix.html.template') html_suffix = _ReadAsset(systrace_dir, 'suffix.html') trace_viewer_html = _ReadAsset(systrace_dir, 'systrace_trace_viewer.html') + catapult_root = os.path.abspath(os.path.dirname(os.path.dirname( + os.path.dirname(__file__)))) + polymer_dir = os.path.join(catapult_root, 'third_party', 'polymer', + 'components', 'webcomponentsjs') + webcomponent_v0_polyfill = _ReadAsset(polymer_dir, 'webcomponents.min.js') + + # Add the polyfill + html_output = html_prefix.replace('{{WEBCOMPONENTS_V0_POLYFILL_JS}}', + webcomponent_v0_polyfill) # Open the file in binary mode to prevent python from changing the # line endings, then write the prefix. html_file = open(output_file_name, 'wb') - html_file.write(html_prefix.replace('{{SYSTRACE_TRACE_VIEWER_HTML}}', + html_file.write(html_output.replace('{{SYSTRACE_TRACE_VIEWER_HTML}}', trace_viewer_html)) + + # Write the trace data itself. There is a separate section of the form # <script class="trace-data" type="application/text"> ... </script> # for each tracing agent (including the controller tracing agent). |