2012-12-12 15:06:50 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<!-- Copyright 2012 the V8 project authors. All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions are
|
|
|
|
met:
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
|
|
copyright notice, this list of conditions and the following
|
|
|
|
disclaimer in the documentation and/or other materials provided
|
|
|
|
with the distribution.
|
|
|
|
* Neither the name of Google Inc. nor the names of its
|
|
|
|
contributors may be used to endorse or promote products derived
|
|
|
|
from this software without specific prior written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
|
|
|
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2019-01-04 12:18:43 +00:00
|
|
|
<meta charset="utf-8">
|
2012-12-12 15:06:50 +00:00
|
|
|
<title>V8 Tick Processor</title>
|
|
|
|
|
2019-01-04 12:18:43 +00:00
|
|
|
<style>
|
2012-12-12 15:06:50 +00:00
|
|
|
body {
|
|
|
|
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
|
|
font-size: 10pt;
|
|
|
|
}
|
|
|
|
h4 {
|
|
|
|
margin-bottom: 0px;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
margin-top: 0px;
|
|
|
|
}
|
|
|
|
</style>
|
2020-09-28 13:50:56 +00:00
|
|
|
<script type="module">
|
|
|
|
import {
|
2021-06-01 18:13:48 +00:00
|
|
|
TickProcessor, LinuxCppEntriesProvider, MacOSCppEntriesProvider,
|
2020-09-28 13:50:56 +00:00
|
|
|
WindowsCppEntriesProvider
|
|
|
|
} from "./tickprocessor.mjs";
|
2012-12-12 15:06:50 +00:00
|
|
|
|
|
|
|
var v8log_content;
|
2020-09-28 13:50:56 +00:00
|
|
|
globalThis.textout;
|
2012-12-12 15:06:50 +00:00
|
|
|
|
2020-09-28 13:50:56 +00:00
|
|
|
globalThis.load_logfile = function(evt) {
|
|
|
|
globalThis.textout.value = "";
|
2012-12-12 15:06:50 +00:00
|
|
|
var f = evt.target.files[0];
|
|
|
|
if (f) {
|
|
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function(event) {
|
|
|
|
v8log_content = event.target.result;
|
|
|
|
start_process();
|
|
|
|
};
|
|
|
|
reader.onerror = function(event) {
|
|
|
|
console.error("File could not be read! Code " + event.target.error.code);
|
|
|
|
};
|
|
|
|
reader.readAsText(f);
|
|
|
|
} else {
|
|
|
|
alert("Failed to load file");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function print(arg) {
|
2020-09-28 13:50:56 +00:00
|
|
|
globalThis.textout.value+=arg+"\n";
|
2012-12-12 15:06:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function start_process() {
|
2017-10-23 22:47:02 +00:00
|
|
|
let DEFAULTS = {
|
2012-12-12 15:06:50 +00:00
|
|
|
logFileName: 'v8.log',
|
|
|
|
platform: 'unix',
|
|
|
|
stateFilter: null,
|
|
|
|
callGraphSize: 5,
|
|
|
|
ignoreUnknown: false,
|
2017-03-10 10:06:06 +00:00
|
|
|
separateIc: true,
|
2012-12-12 15:06:50 +00:00
|
|
|
targetRootFS: '',
|
2019-05-24 11:23:39 +00:00
|
|
|
apkEmbeddedLibrary: '',
|
2012-12-12 15:06:50 +00:00
|
|
|
nm: 'nm'
|
|
|
|
};
|
|
|
|
|
|
|
|
var entriesProviders = {
|
2021-06-01 18:13:48 +00:00
|
|
|
'unix': LinuxCppEntriesProvider,
|
2012-12-12 15:06:50 +00:00
|
|
|
'windows': WindowsCppEntriesProvider,
|
2021-06-01 18:13:48 +00:00
|
|
|
'mac': MacOSCppEntriesProvider
|
2012-12-12 15:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var tickProcessor = new TickProcessor(
|
2017-10-23 22:47:02 +00:00
|
|
|
new (entriesProviders[DEFAULTS.platform])(
|
2019-05-24 11:23:39 +00:00
|
|
|
DEFAULTS.nm, DEFAULTS.targetRootFS, DEFAULTS.apkEmbeddedLibrary),
|
2017-10-23 22:47:02 +00:00
|
|
|
DEFAULTS.separateIc, DEFAULTS.callGraphSize,
|
|
|
|
DEFAULTS.ignoreUnknown, DEFAULTS.stateFilter);
|
2012-12-12 15:06:50 +00:00
|
|
|
|
|
|
|
tickProcessor.processLogChunk(v8log_content);
|
|
|
|
tickProcessor.printStatistics();
|
|
|
|
}
|
2020-09-28 13:50:56 +00:00
|
|
|
</script>
|
|
|
|
<script>
|
2012-12-12 15:06:50 +00:00
|
|
|
function Load() {
|
|
|
|
document.getElementById('fileinput').addEventListener(
|
2020-09-28 13:50:56 +00:00
|
|
|
'change', globalThis.load_logfile, false);
|
|
|
|
globalThis.textout = document.getElementById('textout');
|
2012-12-12 15:06:50 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onLoad="Load()">
|
|
|
|
|
|
|
|
<h3 style="margin-top: 2px;">
|
|
|
|
Chrome V8 profiling log processor
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
Process V8's profiling information log (sampling profiler tick information)
|
|
|
|
in your browser. Particularly useful if you don't have the V8 shell (d8)
|
|
|
|
at hand on your system. You still have to run Chrome with the appropriate
|
|
|
|
<a href="https://code.google.com/p/v8/wiki/ProfilingChromiumWithV8">
|
|
|
|
command line flags</a>
|
|
|
|
to produce the profiling log.
|
|
|
|
</p>
|
|
|
|
<h4>Usage:</h4>
|
|
|
|
<p>
|
|
|
|
Click on the button and browse to the profiling log file (usually, v8.log).
|
|
|
|
Process will start automatically and the output will be visible in the below
|
|
|
|
text area.
|
|
|
|
</p>
|
|
|
|
<h4>Limitations and disclaimer:</h4>
|
|
|
|
<p>
|
|
|
|
This page offers a subset of the functionalities of the command-line tick
|
|
|
|
processor utility in the V8 repository. In particular, this page cannot
|
|
|
|
access the command-line utility that provides library symbol information,
|
|
|
|
hence the [C++] section of the output stays empty. Also consider that this
|
|
|
|
web-based tool is provided only for convenience and quick reference, you
|
|
|
|
should refer to the
|
|
|
|
<a href="https://code.google.com/p/v8/wiki/V8Profiler">
|
|
|
|
command-line</a>
|
|
|
|
version for full output.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<input type="file" id="fileinput" />
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<textarea name="myTextArea" cols="120" rows="40" wrap="off" id="textout"
|
|
|
|
readonly="yes"></textarea>
|
|
|
|
</p>
|
|
|
|
<p style="font-style:italic;">
|
|
|
|
Copyright the V8 Authors - Last change to this page: 12/12/2012
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|