summaryrefslogtreecommitdiff
path: root/deps/v8/tools/system-analyzer/index.html
blob: c9104461147010506f5928ed3b298920437c36ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<!-- Copyright 2020 the V8 project authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->

<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Indicium</title>
  <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
  <!-- <link rel="icon" type="image/png" href="/images/favicon.png"/> -->
  <script type="module" src="index.mjs"></script>
  <link rel="stylesheet" type="text/css" href="./index.css">
  <style>
    #instructions {
      padding: 10px 10px 60px 10px;
      margin: auto;
    }

    kbd {
      background-color: var(--primary-color);
      color: var(--on-primary-color);
      border-radius: 3px;
      border: 1px solid var(--on-primary-color);
      display: inline-block;
      font-size: .9em;
      font-weight: bold;
      padding: 0px 4px 2px 4px;
      white-space: nowrap;
    }

    .theme-switch-wrapper {
      display: inline-block;
      align-items: center;
    }

    .theme-switch {
      display: inline-block;
      height: 34px;
      position: relative;
      width: 60px;
    }

    .theme-switch input {
      display: none;
    }

    .slider {
      background-color: var(--primary-color);
      bottom: 0;
      cursor: pointer;
      left: 0;
      position: absolute;
      right: 0;
      top: 0;
      transition: .4s;
    }

    .slider:before {
      background-color: var(--surface-color);
      bottom: 4px;
      content: "";
      height: 26px;
      left: 4px;
      position: absolute;
      transition: .4s;
      width: 26px;
    }

    input:checked+.slider {
      background-color: var(--primary-color);
    }

    input:checked+.slider:before {
      transform: translateX(26px);
    }

    .slider.round {
      border-radius: 34px;
    }

    .slider.round:before {
      border-radius: 50%;
    }

    #container.initial {
      display: none;
    }

    #container.loaded {
      display: grid;
      align-content: center;
      grid-template-columns: repeat(auto-fit, minmax(400px, 800px));
      grid-template-rows: repeat(auto-fit, minmax(400px, 800px));
      grid-auto-flow: dense;
    }

    #container.loaded>#timeline-panel {
      grid-column: span 2;
      overflow: scroll;
    }

    a {
      color: var(--primary-color);
    }

    a:hover {
      color: var(--secondary-color);
    }
  </style>
  <script type="module">
    import { App } from './index.mjs';

    globalThis.app = new App("#log-file-reader", "#map-panel",
      "#timeline-panel", "#ic-panel", "#map-track", "#ic-track",
      "#source-panel");
  </script>
</head>

<body>
  <div id="content">
    <section id="file-reader">
      <log-file-reader id="log-file-reader"></log-file-reader>
    </section>
    <div class="theme-switch-wrapper">
      <label class="theme-switch" for="checkbox">
        <input type="checkbox" id="checkbox" />
        <div class="slider round"></div>
      </label>
    </div>
    <div id="container" class="initial">
      <timeline-panel id="timeline-panel">
        <timeline-track id="map-track"></timeline-track>
        <timeline-track id="ic-track"></timeline-track>
      </timeline-panel>
      <map-panel id="map-panel"></map-panel>
      <ic-panel id="ic-panel" onchange="app.handleSelectIc(event)"></ic-panel>
      <source-panel id="source-panel"></source-panel>
    </div>
  </div>
  <div id="instructions">
    <h2>Instructions</h2>
    <p>
      Unified web interface to analyse runtime information stored in the v8 log.
    </p>
    For generating log file from
    <a href="https://v8.dev/docs/build" target="_blank">d8</a>:
    <p>
      Log Options:
    </p>
    <dl>
      <dt>--trace-maps:</dt>
      <dd>Log<a href="https://v8.dev/blog/fast-properties" target="_blank">
          Maps</a></dd>
      <dt>--trace_ic:</dt>
      <dd>Log
        <a href="https://mathiasbynens.be/notes/shapes-ics" target="_blank">
          ICs</a></dd>
      <dt>--log-source-code:</dt>
      <dd>Log source code</dd>
    </dl>
    Usage:
    <ul>
      <li><code>/path/do/d8 --trace-maps --trace_ic --log-source-code $FILE
      </code></li>
    </ul>
    For generating a log file from Chrome:
    <ul>
      <li><code>/path/to/chrome --user-data-dir=/var/tmp/chr1 --no-sandbox
        --js-flags='--trace-ic --trace-maps --log-source-code’
        $WEBSITE_URL</code></li>
    </ul>
    <h3>Keyboard Shortcuts for Navigation</h3>
    <dl>
      <dt><kbd>SHIFT</kbd> + <kbd>Arrow Up</kbd></dt>
      <dd>Follow Map transition forward (first child)</dd>

      <dt><kbd>SHIFT</kbd> + <kbd>Arrow Down</kbd></dt>
      <dd>Follow Map transition backwards</dd>

      <dt><kbd>Arrow Up</kbd></dt>
      <dd>Go to previous Map chunk</dd>

      <dt><kbd>Arrow Down</kbd></dt>
      <dd>Go to next Map in chunk</dd>

      <dt><kbd>Arrow Left</kbd></dt>
      <dd>Go to previous chunk</dd>

      <dt><kbd>Arrow Right</kbd></dt>
      <dd>Go to next chunk</dd>

      <dt><kbd>+</kbd></dt>
      <dd>Timeline zoom in</dd>

      <dt><kbd>-</kbd></dt>
      <dd>Timeline zoom out</dd>
    </dl>
  </div>
</body>

</html>