2 <!-- Copyright 2012 the V8 project authors. All rights reserved.
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are
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.
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
30 <meta charset="utf-8"/>
31 <title>V8 Tick Processor</title>
33 <style type="text/css">
35 font-family: Verdana, Arial, Helvetica, sans-serif;
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>
55 <script type="text/javascript">
60 function load_logfile(evt) {
62 var f = evt.target.files[0];
64 var reader = new FileReader();
65 reader.onload = function(event) {
66 v8log_content = event.target.result;
69 reader.onerror = function(event) {
70 console.error("File could not be read! Code " + event.target.error.code);
74 alert("Failed to load file");
79 textout.value+=arg+"\n";
82 function start_process() {
83 ArgumentsProcessor.DEFAULTS = {
84 logFileName: 'v8.log',
85 snapshotLogFileName: null,
95 var entriesProviders = {
96 'unix': UnixCppEntriesProvider,
97 'windows': WindowsCppEntriesProvider,
98 'mac': MacCppEntriesProvider
101 var snapshotLogProcessor; // not used
103 var tickProcessor = new TickProcessor(
104 new (entriesProviders[ArgumentsProcessor.DEFAULTS.platform])(
105 ArgumentsProcessor.DEFAULTS.nm,
106 ArgumentsProcessor.DEFAULTS.targetRootFS),
107 ArgumentsProcessor.DEFAULTS.separateIc,
108 ArgumentsProcessor.DEFAULTS.callGraphSize,
109 ArgumentsProcessor.DEFAULTS.ignoreUnknown,
110 ArgumentsProcessor.DEFAULTS.stateFilter,
111 snapshotLogProcessor);
113 tickProcessor.processLogChunk(v8log_content);
114 tickProcessor.printStatistics();
118 document.getElementById('fileinput').addEventListener(
119 'change', load_logfile, false);
120 textout = document.getElementById('textout');
124 <body onLoad="Load()">
126 <h3 style="margin-top: 2px;">
127 Chrome V8 profiling log processor
130 Process V8's profiling information log (sampling profiler tick information)
131 in your browser. Particularly useful if you don't have the V8 shell (d8)
132 at hand on your system. You still have to run Chrome with the appropriate
133 <a href="https://code.google.com/p/v8/wiki/ProfilingChromiumWithV8">
134 command line flags</a>
135 to produce the profiling log.
139 Click on the button and browse to the profiling log file (usually, v8.log).
140 Process will start automatically and the output will be visible in the below
143 <h4>Limitations and disclaimer:</h4>
145 This page offers a subset of the functionalities of the command-line tick
146 processor utility in the V8 repository. In particular, this page cannot
147 access the command-line utility that provides library symbol information,
148 hence the [C++] section of the output stays empty. Also consider that this
149 web-based tool is provided only for convenience and quick reference, you
151 <a href="https://code.google.com/p/v8/wiki/V8Profiler">
153 version for full output.
156 <input type="file" id="fileinput" />
159 <textarea name="myTextArea" cols="120" rows="40" wrap="off" id="textout"
160 readonly="yes"></textarea>
162 <p style="font-style:italic;">
163 Copyright the V8 Authors - Last change to this page: 12/12/2012