Skip to content

Commit e6036e7

Browse files
hyangahdmitshur
authored andcommitted
[release-branch.go1.14] cmd/trace: update to use WebComponents V0 polyfill
Old trace viewer stopped working with Chrome M80+ because the old trace viewer heavily depended on WebComponents V0 which are deprecated. Trace viewer recently migrated to use WebComponents V0 polyfill (crbug.com/1036492). This CL brings in the newly updated trace_viewer_full.html (sync'd @ 9508452e) and updates the javascript snippet included in the /trace endpoint to use the polyfill. This brings in webcomponents.min.js copied from https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962/third_party/polymer/components/webcomponentsjs/webcomponents.min.js That is necessary because the /trace endpoint needs to import the vulcanized trace_viewer_full.html. It's possible that some features are not working correctly with this polyfill. In that case, report the issue to crbug.com/1036492. There will be a warning message in the UI (yellow banner above the timeline) which can be hidden by clicking the 'hide' button. This allows to render the trace in browsers other than chrome in theory, but I observed some buttons and functions still don't work outside chrome. Updates #34374. Fixes #37343. Change-Id: I0f369b15349dd0f4718c261ec23dfab6a47ace2f Reviewed-on: https://go-review.googlesource.com/c/go/+/219997 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Austin Clements <[email protected]> (cherry picked from commit 75ea964) Reviewed-on: https://go-review.googlesource.com/c/go/+/220323
1 parent c54e369 commit e6036e7

File tree

4 files changed

+1533
-591
lines changed

4 files changed

+1533
-591
lines changed

misc/trace/README.md

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
1-
This directory contains helper file for trace viewer (`go tool trace`).
1+
## Resources for Go's trace viewer
22

3-
`trace_viewer_full.html` was generated by following
4-
[instructions](https://github.com/catapult-project/catapult/blob/master/tracing/docs/embedding-trace-viewer.md)
5-
on revision `dc970d3e1f7b3da5a2849de70ff253acdb70148f`
6-
of [catapult](https://github.com/catapult-project/catapult) using:
3+
Go execution trace UI (`go tool trace`) embeds
4+
Chrome's trace viewer (Catapult) following the
5+
[instructions](
6+
https://chromium.googlesource.com/catapult/+/refs/heads/master/tracing/docs/embedding-trace-viewer.md). This directory contains
7+
the helper files to embed Chrome's trace viewer.
8+
9+
The current resources were generated/copied from
10+
[`Catapult@9508452e18f130c98499cb4c4f1e1efaedee8962`](
11+
https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962).
12+
13+
### Updating `trace_viewer_full.html`
14+
15+
The file was generated by catapult's `vulcanize_trace_viewer` command.
716
```
8-
catapult$ ./tracing/bin/vulcanize_trace_viewer --config=full
9-
catapult$ cp tracing/bin/trace_viewer_full.html $GOROOT/misc/trace/trace_viewer_lean.html
17+
$ git clone https://chromium.googlesource.com/catapult
18+
$ cd catapult
19+
$ ./tracing/bin/vulcanize_trace_viewer --config=full
20+
$ cp tracing/bin/trace_viewer_full.html $GOROOT/misc/trace/trace_viewer_full.html
1021
```
22+
1123
We are supposed to use --config=lean (produces smaller html),
1224
but it is broken at the moment:
1325
https://github.com/catapult-project/catapult/issues/2247
1426

27+
### Updating `webcomponents.min.js`
28+
29+
`webcomponents.min.js` is necessary to let the trace viewer page
30+
to import the `trace_viewer_full.html`.
31+
This is copied from the catapult repo.
32+
33+
```
34+
$ cp third_party/polymer/components/webcomponentsjs/webcomponents.min.js $GOROOT/misc/trace/webcomponents.min.js
35+
```
36+
37+
## Licenses
38+
1539
The license for trace-viewer is as follows:
1640
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
1741
//
@@ -40,3 +64,42 @@ The license for trace-viewer is as follows:
4064
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4165
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4266
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67+
68+
The license for webcomponents.min.js is as follows:
69+
70+
/**
71+
* @license
72+
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
73+
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
74+
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
75+
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
76+
* Code distributed by Google as part of the polymer project is also
77+
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
78+
*/
79+
// Copyright (c) 2014 The Polymer Authors. All rights reserved.
80+
//
81+
// Redistribution and use in source and binary forms, with or without
82+
// modification, are permitted provided that the following conditions are
83+
// met:
84+
//
85+
// * Redistributions of source code must retain the above copyright
86+
// notice, this list of conditions and the following disclaimer.
87+
// * Redistributions in binary form must reproduce the above
88+
// copyright notice, this list of conditions and the following disclaimer
89+
// in the documentation and/or other materials provided with the
90+
// distribution.
91+
// * Neither the name of Google Inc. nor the names of its
92+
// contributors may be used to endorse or promote products derived from
93+
// this software without specific prior written permission.
94+
//
95+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
96+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
97+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
98+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
99+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
100+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
101+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
102+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
103+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
104+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
105+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)