diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 09:57:29 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 09:57:29 +0000 |
commit | 81c78ac1f4407d0a9b1fa1dbb41916ababa225c7 (patch) | |
tree | cedf04cdde1afa84d9617ba1faffcbf7198c200d /webkit | |
parent | 95575b9f2bfff83e75889f038e6c03fb7ff13471 (diff) | |
download | chromium_src-81c78ac1f4407d0a9b1fa1dbb41916ababa225c7.zip chromium_src-81c78ac1f4407d0a9b1fa1dbb41916ababa225c7.tar.gz chromium_src-81c78ac1f4407d0a9b1fa1dbb41916ababa225c7.tar.bz2 |
Add initial version of DevTools Profiler.
To activate it, run Chromium with the following
additional js-flags: "--prof --noprof_auto --logfile=*"
Review URL: http://codereview.chromium.org/115299
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/devtools/debugger_agent.h | 19 | ||||
-rw-r--r-- | webkit/glue/devtools/debugger_agent_impl.cc | 20 | ||||
-rw-r--r-- | webkit/glue/devtools/debugger_agent_impl.h | 10 | ||||
-rw-r--r-- | webkit/glue/devtools/js/debugger_agent.js | 65 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.html | 8 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 109 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools_host_stub.js | 32 | ||||
-rw-r--r-- | webkit/glue/devtools/js/inspector_controller_impl.js | 16 | ||||
-rw-r--r-- | webkit/glue/devtools/js/profiler_processor.js | 201 | ||||
-rw-r--r-- | webkit/webkit.gyp | 8 |
10 files changed, 486 insertions, 2 deletions
diff --git a/webkit/glue/devtools/debugger_agent.h b/webkit/glue/devtools/debugger_agent.h index 45dc899..b310fb3 100644 --- a/webkit/glue/devtools/debugger_agent.h +++ b/webkit/glue/devtools/debugger_agent.h @@ -5,22 +5,37 @@ #ifndef WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_H_ #define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_H_ +#include <string> + #include "webkit/glue/devtools/devtools_rpc.h" #define DEBUGGER_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, \ METHOD4) \ /* Stops v8 execution as soon as it gets control. */ \ METHOD0(DebugBreak) \ + \ /* Requests global context id of the inspected tab. */ \ - METHOD0(GetContextId) + METHOD0(GetContextId) \ + \ + /* Starts profiling (samples collection). */ \ + METHOD0(StartProfiling) \ + \ + /* Stops profiling (samples collection). */ \ + METHOD0(StopProfiling) \ + \ + /* Retrieves a portion of profiler log. */ \ + METHOD1(GetLogLines, int /* position */) DEFINE_RPC_CLASS(DebuggerAgent, DEBUGGER_AGENT_STRUCT) #define DEBUGGER_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, \ METHOD4) \ METHOD1(DebuggerOutput, std::string /* output text */) \ + \ /* Response to GetContextId. */ \ - METHOD1(DidGetContextId, int /* context id */) + METHOD1(DidGetContextId, int /* context id */) \ + \ + METHOD2(DidGetLogLines, std::string /* log */, int /* new_position */) DEFINE_RPC_CLASS(DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT) diff --git a/webkit/glue/devtools/debugger_agent_impl.cc b/webkit/glue/devtools/debugger_agent_impl.cc index 7dabb61..3d18bb5 100644 --- a/webkit/glue/devtools/debugger_agent_impl.cc +++ b/webkit/glue/devtools/debugger_agent_impl.cc @@ -58,11 +58,31 @@ void DebuggerAgentImpl::GetContextId() { delegate_->DidGetContextId(webdevtools_agent_->host_id()); } +void DebuggerAgentImpl::StartProfiling() { + v8::V8::ResumeProfiler(); +} + +void DebuggerAgentImpl::StopProfiling() { + v8::V8::PauseProfiler(); +} + +void DebuggerAgentImpl::GetLogLines(int position) { + static char buffer[65536]; + int read_size = v8::V8::GetLogLines(position, buffer, sizeof(buffer) - 1); + buffer[read_size] = '\0'; + DidGetLogLines(buffer, position + read_size); +} + void DebuggerAgentImpl::DebuggerOutput(const std::string& command) { delegate_->DebuggerOutput(command); webdevtools_agent_->ForceRepaint(); } +void DebuggerAgentImpl::DidGetLogLines( + const std::string& log, int new_position) { + delegate_->DidGetLogLines(log, new_position); +} + // static void DebuggerAgentImpl::ResetUtilityContext( Document* document, diff --git a/webkit/glue/devtools/debugger_agent_impl.h b/webkit/glue/devtools/debugger_agent_impl.h index 2644610..bfeffe3 100644 --- a/webkit/glue/devtools/debugger_agent_impl.h +++ b/webkit/glue/devtools/debugger_agent_impl.h @@ -5,6 +5,8 @@ #ifndef WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_ #define WEBKIT_GLUE_DEVTOOLS_DEBUGGER_AGENT_IMPL_H_ +#include <string> + #include <wtf/HashSet.h> #include "v8.h" @@ -36,8 +38,16 @@ class DebuggerAgentImpl : public DebuggerAgent { virtual void DebugBreak(); virtual void GetContextId(); + virtual void StartProfiling(); + + virtual void StopProfiling(); + + virtual void GetLogLines(int position); + void DebuggerOutput(const std::string& out); + void DidGetLogLines(const std::string& log, int new_position); + // Executes function with the given name in the utility context. Passes node // and json args as parameters. Note that the function called must be // implemented in the inject.js file. diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js index 9670b51..2f5bb3d 100644 --- a/webkit/glue/devtools/js/debugger_agent.js +++ b/webkit/glue/devtools/js/debugger_agent.js @@ -17,6 +17,8 @@ devtools.DebuggerAgent = function() { goog.bind(this.handleDebuggerOutput_, this); RemoteDebuggerAgent.DidGetContextId = goog.bind(this.didGetContextId_, this); + RemoteDebuggerAgent.DidGetLogLines =
+ goog.bind(this.didGetLogLines_, this);
/** * Id of the inspected page global context. It is used for filtering scripts. @@ -63,6 +65,25 @@ devtools.DebuggerAgent = function() { * @type {boolean} */ this.scriptsCacheInitialized_ = false; + + /** + * Whether user has stopped profiling and we are retrieving the rest of + * profiler's log. + * @type {boolean} + */ + this.isProcessingProfile_ = false;
+
+ /**
+ * The position in log file to read from.
+ * @type {number}
+ */
+ this.lastProfileLogPosition_ = 0;
+
+ /**
+ * Profiler processor instance.
+ * @type {devtools.profiler.Processor}
+ */
+ this.profilerProcessor_ = new devtools.profiler.Processor(); }; @@ -287,6 +308,28 @@ devtools.DebuggerAgent.prototype.resolveChildren = function(object, callback) { /** + * Starts (resumes) profiling. + */ +devtools.DebuggerAgent.prototype.startProfiling = function() {
+ if (this.isProcessingProfile_) {
+ return;
+ }
+ RemoteDebuggerAgent.StartProfiling();
+ RemoteDebuggerAgent.GetLogLines(this.lastProfileLogPosition_);
+ WebInspector.setRecordingProfile(true);
+};
+
+
+/** + * Stops (pauses) profiling. + */ +devtools.DebuggerAgent.prototype.stopProfiling = function() {
+ this.isProcessingProfile_ = true;
+ RemoteDebuggerAgent.StopProfiling();
+};
+
+ +/** * Removes specified breakpoint from the v8 debugger. * @param {number} breakpointId Id of the breakpoint in the v8 debugger. */ @@ -519,6 +562,28 @@ devtools.DebuggerAgent.prototype.handleAfterCompileEvent_ = function(msg) { } this.addScriptInfo_(script); }; +
+
+/**
+ * Handles a portion of a profiler log retrieved by GetLogLines call.
+ * @param {string} log A portion of profiler log.
+ * @param {number} newPosition The position in log file to read from
+ * next time.
+ */
+devtools.DebuggerAgent.prototype.didGetLogLines_ = function(
+ log, newPosition) {
+ if (log.length > 0) {
+ this.profilerProcessor_.processLogChunk(log);
+ this.lastProfileLogPosition_ = newPosition;
+ } else if (this.isProcessingProfile_) {
+ this.isProcessingProfile_ = false;
+ WebInspector.setRecordingProfile(false);
+ WebInspector.addProfile(this.profilerProcessor_.createProfileForView());
+ return;
+ }
+ setTimeout(function() { RemoteDebuggerAgent.GetLogLines(newPosition); },
+ this.isProcessingProfile_ ? 100 : 1000);
+};
/** diff --git a/webkit/glue/devtools/js/devtools.html b/webkit/glue/devtools/js/devtools.html index 3176bea..24615d3 100644 --- a/webkit/glue/devtools/js/devtools.html +++ b/webkit/glue/devtools/js/devtools.html @@ -54,6 +54,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="inspector_controller.js"></script> <script type="text/javascript" src="inspector_controller_impl.js"></script> <script type="text/javascript" src="inspector.js"></script> + <script type="text/javascript" src="codemap.js"></script>
+ <script type="text/javascript" src="consarray.js"></script>
+ <script type="text/javascript" src="csvparser.js"></script>
+ <script type="text/javascript" src="profile.js"></script>
+ <script type="text/javascript" src="profile_view.js"></script>
+ <script type="text/javascript" src="profiler_processor.js"></script>
+ <script type="text/javascript" src="splaytree.js"></script>
<script type="text/javascript" src="Object.js"></script> <script type="text/javascript" src="TextPrompt.js"></script> <script type="text/javascript" src="Placard.js"></script> @@ -95,6 +102,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="DatabaseQueryView.js"></script> <script type="text/javascript" src="ScriptView.js"></script> <script type="text/javascript" src="ProfileView.js"></script> + <script type="text/javascript" src="ProfileDataGridTree.js"></script> <script type="text/javascript" src="devtools.js"></script> <script type="text/javascript" src="devtools_host_stub.js"></script> </head> diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index 13bdef0..22d639a 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -713,3 +713,112 @@ WebInspector.Console.prototype._evalInInspectedWindow = function(expression) { oldShow.call(this); }; })(); + + +/**
+ * We don't use WebKit's BottomUpProfileDataGridTree, instead using
+ * our own (because BottomUpProfileDataGridTree's functionality is
+ * implemented in profile_view.js for V8's Tick Processor).
+ *
+ * @param {WebInspector.ProfileView} profileView Profile view.
+ * @param {devtools.profiler.ProfileView} profile Profile.
+ */
+WebInspector.BottomUpProfileDataGridTree = function(profileView, profile) {
+ return WebInspector.buildProfileDataGridTree_(
+ profileView, profile.heavyProfile);
+};
+
+
+/**
+ * We don't use WebKit's TopDownProfileDataGridTree, instead using
+ * our own (because TopDownProfileDataGridTree's functionality is
+ * implemented in profile_view.js for V8's Tick Processor).
+ *
+ * @param {WebInspector.ProfileView} profileView Profile view.
+ * @param {devtools.profiler.ProfileView} profile Profile.
+ */
+WebInspector.TopDownProfileDataGridTree = function(profileView, profile) {
+ return WebInspector.buildProfileDataGridTree_(
+ profileView, profile.treeProfile);
+};
+
+
+/**
+ * A helper function, checks whether a profile node has visible children.
+ *
+ * @param {devtools.profiler.ProfileView.Node} profileNode Profile node.
+ * @return {boolean} Whether a profile node has visible children.
+ */
+WebInspector.nodeHasChildren_ = function(profileNode) {
+ var children = profileNode.children;
+ for (var i = 0, n = children.length; i < n; ++i) {
+ if (children[i].visible) {
+ return true;
+ }
+ }
+ return false;
+};
+
+
+/**
+ * Common code for populating a profiler grid node or a tree with
+ * given profile nodes.
+ *
+ * @param {WebInspector.ProfileDataGridNode|
+ * WebInspector.ProfileDataGridTree} viewNode Grid node or a tree.
+ * @param {WebInspector.ProfileView} profileView Profile view.
+ * @param {Array<devtools.profiler.ProfileView.Node>} children Profile nodes.
+ * @param {WebInspector.ProfileDataGridTree} owningTree Grid tree.
+ */
+WebInspector.populateNode_ = function(
+ viewNode, profileView, children, owningTree) {
+ for (var i = 0, n = children.length; i < n; ++i) {
+ var child = children[i];
+ if (child.visible) {
+ viewNode.appendChild(
+ new WebInspector.ProfileDataGridNode(
+ profileView, child, owningTree,
+ WebInspector.nodeHasChildren_(child)));
+ }
+ }
+};
+
+
+/**
+ * A helper function for building a profile grid tree.
+ *
+ * @param {WebInspector.ProfileView} profileview Profile view.
+ * @param {devtools.profiler.ProfileView} profile Profile.
+ * @return {WebInspector.ProfileDataGridTree} Profile grid tree.
+ */
+WebInspector.buildProfileDataGridTree_ = function(profileView, profile) {
+ var children = profile.head.children;
+ var dataGridTree = new WebInspector.ProfileDataGridTree(
+ profileView, profile.head);
+ WebInspector.populateNode_(dataGridTree, profileView, children, dataGridTree);
+ return dataGridTree;
+};
+
+
+/**
+ * @override
+ */
+WebInspector.ProfileDataGridNode.prototype._populate = function(event) {
+ var children = this.profileNode.children;
+ WebInspector.populateNode_(this, this.profileView, children, this.tree);
+ this.removeEventListener("populate", this._populate, this);
+};
+
+
+// As columns in data grid can't be changed after initialization,
+// we need to intercept the constructor and modify columns upon creation.
+(function InterceptDataGridForProfiler() {
+ var originalDataGrid = WebInspector.DataGrid;
+ WebInspector.DataGrid = function(columns) {
+ if (('average' in columns) && ('calls' in columns)) {
+ delete columns['average'];
+ delete columns['calls'];
+ }
+ return new originalDataGrid(columns);
+ };
+})();
diff --git a/webkit/glue/devtools/js/devtools_host_stub.js b/webkit/glue/devtools/js/devtools_host_stub.js index b43c802..35e89a3 100644 --- a/webkit/glue/devtools/js/devtools_host_stub.js +++ b/webkit/glue/devtools/js/devtools_host_stub.js @@ -20,6 +20,24 @@ RemoteDebuggerAgentStub.prototype.GetContextId = function() { RemoteDebuggerAgent.DidGetContextId(3); }; +RemoteDebuggerAgentStub.prototype.StopProfiling = function() {
+};
+
+RemoteDebuggerAgentStub.prototype.StartProfiling = function() {
+};
+
+RemoteDebuggerAgentStub.prototype.GetLogLines = function(pos) {
+ if (pos < RemoteDebuggerAgentStub.ProfilerLogBuffer.length) {
+ setTimeout(function() {
+ RemoteDebuggerAgent.DidGetLogLines(
+ RemoteDebuggerAgentStub.ProfilerLogBuffer,
+ pos + RemoteDebuggerAgentStub.ProfilerLogBuffer.length);
+ },
+ 100);
+ } else {
+ setTimeout(function() { RemoteDebuggerAgent.DidGetLogLines('', pos); }, 100);
+ }
+};
/** * @constructor @@ -205,6 +223,20 @@ RemoteToolsAgentStub.prototype.ClearConsoleMessages = function() { }; +RemoteDebuggerAgentStub.ProfilerLogBuffer =
+ 'code-creation,LazyCompile,0x1000,256,"test1 http://aaa.js:1"\n' +
+ 'code-creation,LazyCompile,0x2000,256,"test2 http://bbb.js:2"\n' +
+ 'code-creation,LazyCompile,0x3000,256,"test3 http://ccc.js:3"\n' +
+ 'tick,0x1010,0x0,3\n' +
+ 'tick,0x2020,0x0,3,0x1010\n' +
+ 'tick,0x2020,0x0,3,0x1010\n' +
+ 'tick,0x3010,0x0,3,0x2020, 0x1010\n' +
+ 'tick,0x2020,0x0,3,0x1010\n' +
+ 'tick,0x2030,0x0,3,0x2020, 0x1010\n' +
+ 'tick,0x2020,0x0,3,0x1010\n' +
+ 'tick,0x1010,0x0,3\n';
+ + /** * @constructor */ diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js index 45abbe2..3d349df 100644 --- a/webkit/glue/devtools/js/inspector_controller_impl.js +++ b/webkit/glue/devtools/js/inspector_controller_impl.js @@ -144,5 +144,21 @@ devtools.InspectorControllerImpl.prototype.setPauseOnExceptions = function( return devtools.tools.getDebuggerAgent().setPauseOnExceptions(value); }; +
+/**
+ * @override
+ */
+devtools.InspectorControllerImpl.prototype.startProfiling = function() {
+ devtools.tools.getDebuggerAgent().startProfiling();
+};
+
+
+/**
+ * @override
+ */
+devtools.InspectorControllerImpl.prototype.stopProfiling = function() {
+ devtools.tools.getDebuggerAgent().stopProfiling();
+};
+ var InspectorController = new devtools.InspectorControllerImpl(); diff --git a/webkit/glue/devtools/js/profiler_processor.js b/webkit/glue/devtools/js/profiler_processor.js new file mode 100644 index 0000000..0f8a9ad --- /dev/null +++ b/webkit/glue/devtools/js/profiler_processor.js @@ -0,0 +1,201 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Profiler processor is used to process log file produced
+ * by V8 and produce an internal profile representation which is used
+ * for building profile views in 'Profiles' tab.
+ */
+goog.provide('devtools.profiler.Processor');
+
+
+/**
+ * Ancestor of a profile object that leaves out only JS-related functions.
+ * @constructor
+ */
+devtools.profiler.JsProfile = function() {
+ devtools.profiler.Profile.call(this);
+};
+goog.inherits(devtools.profiler.JsProfile, devtools.profiler.Profile);
+
+
+/**
+ * @type {RegExp}
+ */
+devtools.profiler.JsProfile.JS_FUNC_RE = /^(LazyCompile|Function|Script):/;
+
+
+/**
+ * @override
+ */
+devtools.profiler.JsProfile.prototype.skipThisFunction = function(name) {
+ return !devtools.profiler.JsProfile.JS_FUNC_RE.test(name);
+};
+
+
+/**
+ * Profiler processor. Consumes profiler log and builds profile views.
+ * @constructor
+ */
+devtools.profiler.Processor = function() {
+ /**
+ * Current profile.
+ * @type {devtools.profiler.JsProfile}
+ */
+ this.profile_ = new devtools.profiler.JsProfile();
+
+ /**
+ * Builder of profile views.
+ * @type {devtools.profiler.ViewBuilder}
+ */
+ this.viewBuilder_ = new devtools.profiler.ViewBuilder(1);
+
+ /**
+ * Next profile id.
+ * @type {number}
+ */
+ this.profileId_ = 1;
+};
+
+
+/**
+ * A dispatch table for V8 profiler event log records.
+ * @private
+ */
+devtools.profiler.Processor.RecordsDispatch_ = {
+ 'code-creation': { parsers: [null, parseInt, parseInt, null],
+ processor: 'processCodeCreation_' },
+ 'code-move': { parsers: [parseInt, parseInt],
+ processor: 'processCodeMove_' },
+ 'code-delete': { parsers: [parseInt], processor: 'processCodeDelete_' },
+ 'tick': { parsers: [parseInt, parseInt, parseInt, 'var-args'],
+ processor: 'processTick_' },
+ // Not used in DevTools Profiler.
+ 'profiler': null,
+ 'shared-library': null,
+ // Obsolete row types.
+ 'code-allocate': null,
+ 'begin-code-region': null,
+ 'end-code-region': null
+};
+
+
+/**
+ * Processes a portion of V8 profiler event log.
+ *
+ * @param {string} chunk A portion of log.
+ */
+devtools.profiler.Processor.prototype.processLogChunk = function(chunk) {
+ this.processLog_(chunk.split('\n'));
+};
+
+
+/**
+ * Processes a log lines.
+ *
+ * @param {Array<string>} lines Log lines.
+ * @private
+ */
+devtools.profiler.Processor.prototype.processLog_ = function(lines) {
+ var csvParser = new devtools.profiler.CsvParser();
+ try {
+ for (var i = 0, n = lines.length; i < n; ++i) {
+ var line = lines[i];
+ if (!line) {
+ continue;
+ }
+ var fields = csvParser.parseLine(line);
+ this.dispatchLogRow_(fields);
+ }
+ } catch (e) {
+ debugPrint('line ' + (i + 1) + ': ' + (e.message || e));
+ throw e;
+ }
+};
+
+
+/**
+ * Does a dispatch of a log record.
+ *
+ * @param {Array<string>} fields Log record.
+ * @private
+ */
+devtools.profiler.Processor.prototype.dispatchLogRow_ = function(fields) {
+ // Obtain the dispatch.
+ var command = fields[0];
+ if (!(command in devtools.profiler.Processor.RecordsDispatch_)) {
+ throw new Error('unknown command: ' + command);
+ }
+ var dispatch = devtools.profiler.Processor.RecordsDispatch_[command];
+
+ if (dispatch === null) {
+ return;
+ }
+
+ // Parse fields.
+ var parsedFields = [];
+ for (var i = 0; i < dispatch.parsers.length; ++i) {
+ var parser = dispatch.parsers[i];
+ if (parser === null) {
+ parsedFields.push(fields[1 + i]);
+ } else if (typeof parser == 'function') {
+ parsedFields.push(parser(fields[1 + i]));
+ } else {
+ // var-args
+ parsedFields.push(fields.slice(1 + i));
+ break;
+ }
+ }
+
+ // Run the processor.
+ this[dispatch.processor].apply(this, parsedFields);
+};
+
+
+devtools.profiler.Processor.prototype.processCodeCreation_ = function(
+ type, start, size, name) {
+ this.profile_.addCode(type, name, start, size);
+};
+
+
+devtools.profiler.Processor.prototype.processCodeMove_ = function(from, to) {
+ this.profile_.moveCode(from, to);
+};
+
+
+devtools.profiler.Processor.prototype.processCodeDelete_ = function(start) {
+ this.profile_.deleteCode(start);
+};
+
+
+devtools.profiler.Processor.prototype.processTick_ = function(
+ pc, sp, vmState, stack) {
+ var fullStack = [pc];
+ for (var i = 0, n = stack.length; i < n; ++i) {
+ var frame = stack[i];
+ // Leave only numbers starting with 0x. Filter possible 'overflow' string.
+ if (frame.charAt(0) == '0') {
+ fullStack.push(parseInt(frame, 16));
+ }
+ }
+ this.profile_.recordTick(fullStack);
+};
+
+
+/**
+ * Creates a profile for further displaying in ProfileView.
+ */
+devtools.profiler.Processor.prototype.createProfileForView = function() {
+ var profile = new devtools.profiler.ProfileView();
+ profile.uid = this.profileId_++;
+ profile.title = UserInitiatedProfileName + '.' + profile.uid;
+ // A trick to cope with ProfileView.bottomUpProfileDataGridTree and
+ // ProfileView.topDownProfileDataGridTree behavior.
+ profile.head = profile;
+ profile.heavyProfile = this.viewBuilder_.buildView(
+ this.profile_.getBottomUpProfile(), true);
+ profile.treeProfile = this.viewBuilder_.buildView(
+ this.profile_.getTopDownProfile());
+ return profile;
+};
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 202f52e..3a8930c 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -4649,6 +4649,7 @@ 'glue/devtools/js/inspector_controller_impl.js', 'glue/devtools/js/json.js', 'glue/devtools/js/net_agent.js', + 'glue/devtools/js/profiler_processor.js', 'inspector/debugger.css', 'inspector/debugger.html', 'inspector/DebuggerConsole.js', @@ -4678,6 +4679,7 @@ '../third_party/WebKit/WebCore/inspector/front-end/PanelEnablerView.js', '../third_party/WebKit/WebCore/inspector/front-end/Placard.js', '../third_party/WebKit/WebCore/inspector/front-end/ProfilesPanel.js', + '../third_party/WebKit/WebCore/inspector/front-end/ProfileDataGridTree.js', '../third_party/WebKit/WebCore/inspector/front-end/ProfileView.js', '../third_party/WebKit/WebCore/inspector/front-end/PropertiesSection.js', '../third_party/WebKit/WebCore/inspector/front-end/PropertiesSidebarPane.js', @@ -4698,6 +4700,12 @@ '../third_party/WebKit/WebCore/inspector/front-end/treeoutline.js', '../third_party/WebKit/WebCore/inspector/front-end/utilities.js', '../third_party/WebKit/WebCore/inspector/front-end/View.js', + '../v8/tools/codemap.js', + '../v8/tools/consarray.js', + '../v8/tools/csvparser.js', + '../v8/tools/profile.js', + '../v8/tools/profile_view.js', + '../v8/tools/splaytree.js', ], }, { |