blob: a785a6e3c869969462e6f41ac08ec8f4dc0b1909 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001<!DOCTYPE html>
2<!-- Copyright 2012 the V8 project authors. All rights reserved.
3
4Redistribution and use in source and binary forms, with or without
5modification, are permitted provided that the following conditions are
6met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above
10 copyright notice, this list of conditions and the following
11 disclaimer in the documentation and/or other materials provided
12 with the distribution.
13 * Neither the name of Google Inc. nor the names of its
14 contributors may be used to endorse or promote products derived
15 from this software without specific prior written permission.
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
27
28<html lang="en">
29<head>
30 <meta charset="utf-8"/>
31 <title>V8 Tick Processor</title>
32
33 <style type="text/css">
34 body {
35 font-family: Verdana, Arial, Helvetica, sans-serif;
36 font-size: 10pt;
37 }
38 h4 {
39 margin-bottom: 0px;
40 }
41 p {
42 margin-top: 0px;
43 }
44 </style>
45
46 <script src="splaytree.js"></script>
47 <script src="codemap.js"></script>
48 <script src="csvparser.js"></script>
49 <script src="consarray.js"></script>
50 <script src="profile.js"></script>
51 <script src="profile_view.js"></script>
52 <script src="logreader.js"></script>
53 <script src="tickprocessor.js"></script>
54
55 <script type="text/javascript">
56
57var v8log_content;
58var textout;
59
60function load_logfile(evt) {
61 textout.value = "";
62 var f = evt.target.files[0];
63 if (f) {
64 var reader = new FileReader();
65 reader.onload = function(event) {
66 v8log_content = event.target.result;
67 start_process();
68 };
69 reader.onerror = function(event) {
70 console.error("File could not be read! Code " + event.target.error.code);
71 };
72 reader.readAsText(f);
73 } else {
74 alert("Failed to load file");
75 }
76}
77
78function print(arg) {
79 textout.value+=arg+"\n";
80}
81
82function start_process() {
83 ArgumentsProcessor.DEFAULTS = {
84 logFileName: 'v8.log',
Ben Murdochb8a8cc12014-11-26 15:28:44 +000085 platform: 'unix',
86 stateFilter: null,
87 callGraphSize: 5,
88 ignoreUnknown: false,
89 separateIc: false,
90 targetRootFS: '',
91 nm: 'nm'
92 };
93
94 var entriesProviders = {
95 'unix': UnixCppEntriesProvider,
96 'windows': WindowsCppEntriesProvider,
97 'mac': MacCppEntriesProvider
98 };
99
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000100 var tickProcessor = new TickProcessor(
101 new (entriesProviders[ArgumentsProcessor.DEFAULTS.platform])(
102 ArgumentsProcessor.DEFAULTS.nm,
103 ArgumentsProcessor.DEFAULTS.targetRootFS),
104 ArgumentsProcessor.DEFAULTS.separateIc,
105 ArgumentsProcessor.DEFAULTS.callGraphSize,
106 ArgumentsProcessor.DEFAULTS.ignoreUnknown,
Ben Murdochda12d292016-06-02 14:46:10 +0100107 ArgumentsProcessor.DEFAULTS.stateFilter);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000108
109 tickProcessor.processLogChunk(v8log_content);
110 tickProcessor.printStatistics();
111}
112
113function Load() {
114 document.getElementById('fileinput').addEventListener(
115 'change', load_logfile, false);
116 textout = document.getElementById('textout');
117}
118</script>
119</head>
120<body onLoad="Load()">
121
122<h3 style="margin-top: 2px;">
123 Chrome V8 profiling log processor
124</h3>
125<p>
126Process V8's profiling information log (sampling profiler tick information)
127in your browser. Particularly useful if you don't have the V8 shell (d8)
128at hand on your system. You still have to run Chrome with the appropriate
129<a href="https://code.google.com/p/v8/wiki/ProfilingChromiumWithV8">
130 command line flags</a>
131to produce the profiling log.
132</p>
133<h4>Usage:</h4>
134<p>
135Click on the button and browse to the profiling log file (usually, v8.log).
136Process will start automatically and the output will be visible in the below
137text area.
138</p>
139<h4>Limitations and disclaimer:</h4>
140<p>
141This page offers a subset of the functionalities of the command-line tick
142processor utility in the V8 repository. In particular, this page cannot
143access the command-line utility that provides library symbol information,
144hence the [C++] section of the output stays empty. Also consider that this
145web-based tool is provided only for convenience and quick reference, you
146should refer to the
147<a href="https://code.google.com/p/v8/wiki/V8Profiler">
148 command-line</a>
149version for full output.
150</p>
151<p>
152<input type="file" id="fileinput" />
153</p>
154<p>
155<textarea name="myTextArea" cols="120" rows="40" wrap="off" id="textout"
156 readonly="yes"></textarea>
157</p>
158<p style="font-style:italic;">
159Copyright the V8 Authors - Last change to this page: 12/12/2012
160</p>
161
162
163</body>
164</html>