Commit 3b17e107 authored by alph's avatar alph Committed by Commit bot

DevTools: Refactor Profiler domain interface

Flatten nodes into an array.

Review-Url: https://codereview.chromium.org/2244783004
Cr-Commit-Position: refs/heads/master@{#412613}
parent efc134da
...@@ -46,22 +46,15 @@ function test() ...@@ -46,22 +46,15 @@ function test()
function checkInnerProfile(profile) function checkInnerProfile(profile)
{ {
InspectorTest.log("SUCCESS: retrieved '42' profile"); InspectorTest.log("SUCCESS: retrieved '42' profile");
var root = profile.head; if (!findFunctionInProfile(profile.nodes, "collectProfiles"))
if (!findFunctionInProfile(root, "collectProfiles"))
return InspectorTest.fail("collectProfiles function not found in the profile: " + JSON.stringify(profile, null, 4)); return InspectorTest.fail("collectProfiles function not found in the profile: " + JSON.stringify(profile, null, 4));
InspectorTest.log("SUCCESS: found 'collectProfiles' function in the profile"); InspectorTest.log("SUCCESS: found 'collectProfiles' function in the profile");
InspectorTest.completeTest(); InspectorTest.completeTest();
} }
function findFunctionInProfile(node, functionName) function findFunctionInProfile(nodes, functionName)
{ {
if (node.callFrame.functionName === functionName) return nodes.some(n => n.callFrame.functionName === functionName);
return true;
var children = node.children;
for (var i = 0; i < children.length; ++i)
if (findFunctionInProfile(children[i], functionName))
return true;
return false;
} }
} }
</script> </script>
......
...@@ -6,15 +6,15 @@ ...@@ -6,15 +6,15 @@
function test() function test()
{ {
var nodes = 1000; var nodesCount = 1000;
function buildTree(count) function buildTree(startId, count)
{ {
// Build a call tree of a chain form: foo1 -> foo2 -> foo3 -> ... // Build a call tree of a chain form: foo1 -> foo2 -> foo3 -> ...
// This should give a O(n^2) nodes in bottom-up tree. // This should give a O(n^2) nodes in bottom-up tree.
var node = null; var nodes = [];
for (var i = count; i > 0; --i) { for (var i = 1; i <= count; ++i) {
var child = node; nodes.push({
node = { "id": startId + i - 1,
"callFrame": "callFrame":
{ {
"functionName": "foo" + i, "functionName": "foo" + i,
...@@ -23,13 +23,10 @@ function test() ...@@ -23,13 +23,10 @@ function test()
"lineNumber": i "lineNumber": i
}, },
"hitCount": 10, "hitCount": 10,
"callUID": 10000 + i, "children": i < count ? [startId + i] : []
"children": [] });
};
if (child)
node.children.push(child);
} }
return node; return nodes;
} }
var profileAndExpectations = { var profileAndExpectations = {
"title": "profile1", "title": "profile1",
...@@ -37,7 +34,9 @@ function test() ...@@ -37,7 +34,9 @@ function test()
return WebInspector.targetManager.targets()[0]; return WebInspector.targetManager.targets()[0];
}, },
"_profile": { "_profile": {
"head": { "nodes": [
{
"id": 0,
"callFrame": "callFrame":
{ {
"functionName": "(root)", "functionName": "(root)",
...@@ -46,9 +45,10 @@ function test() ...@@ -46,9 +45,10 @@ function test()
"lineNumber": 0, "lineNumber": 0,
}, },
"hitCount": 1, "hitCount": 1,
"callUID": 1000, "children": [1,2]
"children": [ },
{ {
"id": 1,
"callFrame": "callFrame":
{ {
"functionName": "(idle)", "functionName": "(idle)",
...@@ -57,15 +57,12 @@ function test() ...@@ -57,15 +57,12 @@ function test()
"lineNumber": 1 "lineNumber": 1
}, },
"hitCount": 2, "hitCount": 2,
"callUID": 2,
"children": [] "children": []
}, }
buildTree(nodes) ].concat(buildTree(2, nodesCount)),
]
},
"idleTime": 0.002, "idleTime": 0.002,
"startTime": 0, "startTime": 0,
"endTime": nodes * 0.01 + 0.003 "endTime": nodesCount * 0.01 + 0.003
} }
}; };
var view = new WebInspector.CPUProfileView(profileAndExpectations); var view = new WebInspector.CPUProfileView(profileAndExpectations);
......
...@@ -12,7 +12,9 @@ function test() ...@@ -12,7 +12,9 @@ function test()
return WebInspector.targetManager.targets()[0]; return WebInspector.targetManager.targets()[0];
}, },
"_profile": { "_profile": {
"head": { "nodes": [
{
"id": 0,
"callFrame": "callFrame":
{ {
"functionName": "(root)", "functionName": "(root)",
...@@ -21,9 +23,10 @@ function test() ...@@ -21,9 +23,10 @@ function test()
"lineNumber": 0 "lineNumber": 0
}, },
"hitCount": 350, "hitCount": 350,
"callUID": 1000, "children": [1, 2, 5]
"children": [ },
{ {
"id": 1,
"callFrame": "callFrame":
{ {
"functionName": "(idle)", "functionName": "(idle)",
...@@ -32,10 +35,10 @@ function test() ...@@ -32,10 +35,10 @@ function test()
"lineNumber": 1 "lineNumber": 1
}, },
"hitCount": 1000, "hitCount": 1000,
"callUID": 2,
"children": [] "children": []
}, },
{ {
"id": 2,
"callFrame": "callFrame":
{ {
"functionName": "A", "functionName": "A",
...@@ -44,9 +47,10 @@ function test() ...@@ -44,9 +47,10 @@ function test()
"lineNumber": 4642 "lineNumber": 4642
}, },
"hitCount": 250, "hitCount": 250,
"callUID": 1001, "children": [3]
"children": [ },
{ {
"id": 3,
"callFrame": "callFrame":
{ {
"functionName": "C", "functionName": "C",
...@@ -55,9 +59,10 @@ function test() ...@@ -55,9 +59,10 @@ function test()
"lineNumber": 525 "lineNumber": 525
}, },
"hitCount": 100, "hitCount": 100,
"callUID": 2000, "children": [4]
"children": [ },
{ {
"id": 4,
"callFrame": "callFrame":
{ {
"functionName": "D", "functionName": "D",
...@@ -66,14 +71,10 @@ function test() ...@@ -66,14 +71,10 @@ function test()
"lineNumber": 425 "lineNumber": 425
}, },
"hitCount": 20, "hitCount": 20,
"callUID": 3000,
"children": [] "children": []
}
]
}
]
}, },
{ {
"id": 5,
"callFrame": "callFrame":
{ {
"functionName": "B", "functionName": "B",
...@@ -82,9 +83,10 @@ function test() ...@@ -82,9 +83,10 @@ function test()
"lineNumber": 4662 "lineNumber": 4662
}, },
"hitCount": 150, "hitCount": 150,
"callUID": 1002, "children": [6]
"children": [ },
{ {
"id": 6,
"callFrame": "callFrame":
{ {
"functionName": "C", "functionName": "C",
...@@ -93,9 +95,10 @@ function test() ...@@ -93,9 +95,10 @@ function test()
"lineNumber": 525 "lineNumber": 525
}, },
"hitCount": 100, "hitCount": 100,
"callUID": 2000, "children": [7]
"children": [ },
{ {
"id": 7,
"callFrame": "callFrame":
{ {
"functionName": "D", "functionName": "D",
...@@ -104,15 +107,9 @@ function test() ...@@ -104,15 +107,9 @@ function test()
"lineNumber": 425 "lineNumber": 425
}, },
"hitCount": 30, "hitCount": 30,
"callUID": 3000,
"children": [] "children": []
} }
] ],
}
]
}
]
},
"startTime": 0, "startTime": 0,
"endTime": 1.000 "endTime": 1.000
} }
......
...@@ -931,6 +931,7 @@ function test() ...@@ -931,6 +931,7 @@ function test()
var profile = profileAndExpectations._profile; var profile = profileAndExpectations._profile;
var startTime = profile.startTime * 1000; var startTime = profile.startTime * 1000;
var endTime = profile.endTime * 1000; var endTime = profile.endTime * 1000;
profile.nodes = flattenNodes(profile.head);
profile.startTime /= 1000; profile.startTime /= 1000;
profile.endTime /= 1000; profile.endTime /= 1000;
var samplingInterval = (endTime - startTime) / (profile.samples.length - 1); var samplingInterval = (endTime - startTime) / (profile.samples.length - 1);
...@@ -949,6 +950,14 @@ function test() ...@@ -949,6 +950,14 @@ function test()
console.log(Object.values(overviewPane._calculateDrawData(2))); console.log(Object.values(overviewPane._calculateDrawData(2)));
console.log(Object.values(overviewPane._calculateDrawData(1))); console.log(Object.values(overviewPane._calculateDrawData(1)));
InspectorTest.completeTest(); InspectorTest.completeTest();
function flattenNodes(node)
{
var childrenIds = node.children.map(n => n.id);
var result = node.children.reduce((res, n) => res.concat(flattenNodes(n)), [node]);
node.children = childrenIds;
return result;
}
} }
</script> </script>
......
...@@ -128,6 +128,7 @@ function test() ...@@ -128,6 +128,7 @@ function test()
"endTime": 100000 + 111.110 + 22.220 + 1.000, "endTime": 100000 + 111.110 + 22.220 + 1.000,
"samples": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] "samples": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
}; };
profile.nodes = flattenNodes(profile.head);
var model = new WebInspector.CPUProfileDataModel(profile); var model = new WebInspector.CPUProfileDataModel(profile);
printTree("", model.profileHead); printTree("", model.profileHead);
function printTree(padding, node) function printTree(padding, node)
...@@ -137,6 +138,13 @@ function test() ...@@ -137,6 +138,13 @@ function test()
} }
InspectorTest.addResult(model.samples.join(", ")); InspectorTest.addResult(model.samples.join(", "));
InspectorTest.completeTest(); InspectorTest.completeTest();
function flattenNodes(node)
{
var childrenIds = node.children.map(n => n.id);
var result = node.children.reduce((res, n) => res.concat(flattenNodes(n)), [node]);
node.children = childrenIds;
return result;
}
} }
</script> </script>
......
...@@ -9,43 +9,49 @@ function test() ...@@ -9,43 +9,49 @@ function test()
var cpuProfile = { var cpuProfile = {
startTime: 10, startTime: 10,
endTime: 20, endTime: 20,
head: { nodes: [
{
id: 0,
callFrame: { functionName: "(root)" }, callFrame: { functionName: "(root)" },
hitCount: 0, hitCount: 0,
children: [ children: [1, 2]
},
{ {
id: 1,
callFrame: { functionName: "foo1" }, callFrame: { functionName: "foo1" },
hitCount: 100, hitCount: 100,
positionTicks: [{line:1, ticks:10}, {line:2, ticks:20}, {line:3, ticks:30}, {line:4, ticks:40}], positionTicks: [{line:1, ticks:10}, {line:2, ticks:20}, {line:3, ticks:30}, {line:4, ticks:40}],
children: [] children: []
}, },
{ {
id: 2,
callFrame: { functionName: "foo2" }, callFrame: { functionName: "foo2" },
hitCount: 200, hitCount: 200,
positionTicks: [{line:100, ticks:1}, {line:102, ticks:190}], positionTicks: [{line:100, ticks:1}, {line:102, ticks:190}],
children: [] children: [3]
}, },
{ {
id: 3,
callFrame: { functionName: "null" }, callFrame: { functionName: "null" },
hitCount: 0, hitCount: 0,
positionTicks: [], positionTicks: [],
children: [ children: [4, 5]
},
{ {
id: 4,
callFrame: { functionName: "bar" }, callFrame: { functionName: "bar" },
hitCount: 300, hitCount: 300,
positionTicks: [{line:55, ticks:22}], positionTicks: [{line:55, ticks:22}],
children: [] children: []
}, },
{ {
id: 5,
callFrame: { functionName: "baz" }, callFrame: { functionName: "baz" },
hitCount: 400, hitCount: 400,
// no positionTicks for the node. // no positionTicks for the node.
children: [] children: []
} }
] ]
}
]
}
}; };
InspectorTest.addSniffer(WebInspector.CodeMirrorTextEditor.prototype, "setGutterDecoration", decorationAdded, true); InspectorTest.addSniffer(WebInspector.CodeMirrorTextEditor.prototype, "setGutterDecoration", decorationAdded, true);
...@@ -56,17 +62,11 @@ function test() ...@@ -56,17 +62,11 @@ function test()
InspectorTest.addResult(`${line} ${type} ${element.textContent} ${element.style.backgroundColor}`); InspectorTest.addResult(`${line} ${type} ${element.textContent} ${element.style.backgroundColor}`);
} }
function setUrls(url, node)
{
node.callFrame.url = url;
node.children.forEach(setUrls.bind(null, url));
}
function frameRevealed(frame) function frameRevealed(frame)
{ {
var url = frame.uiSourceCode().url(); var url = frame.uiSourceCode().url();
InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url)); InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url));
setUrls(url, cpuProfile.head); cpuProfile.nodes.forEach(n => n.callFrame.url = url);
var lineProfile = new WebInspector.LineLevelProfile.instance(); var lineProfile = new WebInspector.LineLevelProfile.instance();
lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuProfile)); lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuProfile));
setTimeout(() => InspectorTest.completeTest(), 0); setTimeout(() => InspectorTest.completeTest(), 0);
......
...@@ -262,13 +262,18 @@ function test() ...@@ -262,13 +262,18 @@ function test()
var cpuProfile = { var cpuProfile = {
startTime: 420, startTime: 420,
endTime: 430, endTime: 430,
head: { nodes: [
{
callFrame: { functionName: "(root)" }, callFrame: { functionName: "(root)" },
id: 1, id: 1,
children: [{ children: [2]
},
{
callFrame: { functionName: "foo" }, callFrame: { functionName: "foo" },
id: 2, id: 2,
children: [{ children: [3, 4]
},
{
callFrame: { functionName: "bar" }, callFrame: { functionName: "bar" },
id: 3, id: 3,
children: [] children: []
...@@ -277,9 +282,8 @@ function test() ...@@ -277,9 +282,8 @@ function test()
callFrame: { functionName: "baz" }, callFrame: { functionName: "baz" },
id: 4, id: 4,
children: [] children: []
}] }
}] ],
},
timestamps: [421000, 422000, 423000, 424000, 425000, 426000, 427000, 428000, 429000], timestamps: [421000, 422000, 423000, 424000, 425000, 426000, 427000, 428000, 429000],
samples: [2, 2, 3, 3, 3, 4, 4, 2, 2 ] samples: [2, 2, 3, 3, 3, 4, 4, 2, 2 ]
}; };
......
...@@ -42,7 +42,7 @@ WebInspector.CPUProfileDataModel = function(profile) ...@@ -42,7 +42,7 @@ WebInspector.CPUProfileDataModel = function(profile)
this.profileStartTime = profile.startTime * 1000; this.profileStartTime = profile.startTime * 1000;
this.profileEndTime = profile.endTime * 1000; this.profileEndTime = profile.endTime * 1000;
this.totalHitCount = 0; this.totalHitCount = 0;
this.profileHead = this._translateProfileTree(profile.head); this.profileHead = this._translateProfileTree(profile.nodes);
WebInspector.ProfileTreeModel.call(this, this.profileHead); WebInspector.ProfileTreeModel.call(this, this.profileHead);
this._extractMetaNodes(); this._extractMetaNodes();
if (this.samples) { if (this.samples) {
...@@ -54,19 +54,11 @@ WebInspector.CPUProfileDataModel = function(profile) ...@@ -54,19 +54,11 @@ WebInspector.CPUProfileDataModel = function(profile)
WebInspector.CPUProfileDataModel.prototype = { WebInspector.CPUProfileDataModel.prototype = {
/** /**
* @param {!ProfilerAgent.CPUProfileNode} root * @param {!Array<!ProfilerAgent.CPUProfileNode>} nodes
* @return {!WebInspector.CPUProfileNode} * @return {!WebInspector.CPUProfileNode}
*/ */
_translateProfileTree: function(root) _translateProfileTree: function(nodes)
{ {
/**
* @param {!ProfilerAgent.CPUProfileNode} node
* @return {number}
*/
function computeHitCountForSubtree(node)
{
return node.children.reduce((acc, node) => acc + computeHitCountForSubtree(node), node.hitCount);
}
/** /**
* @param {!ProfilerAgent.CPUProfileNode} node * @param {!ProfilerAgent.CPUProfileNode} node
* @return {boolean} * @return {boolean}
...@@ -77,14 +69,21 @@ WebInspector.CPUProfileDataModel.prototype = { ...@@ -77,14 +69,21 @@ WebInspector.CPUProfileDataModel.prototype = {
return !!node.callFrame.url && node.callFrame.url.startsWith("native "); return !!node.callFrame.url && node.callFrame.url.startsWith("native ");
return !!node.url && node.url.startsWith("native "); return !!node.url && node.url.startsWith("native ");
} }
this.totalHitCount = computeHitCountForSubtree(root); /** @type {!Map<number, !ProfilerAgent.CPUProfileNode>} */
var nodeByIdMap = new Map();
for (var i = 0; i < nodes.length; ++i) {
var node = nodes[i];
nodeByIdMap.set(node.id, node);
}
this.totalHitCount = nodes.reduce((acc, node) => acc + node.hitCount, 0);
var sampleTime = (this.profileEndTime - this.profileStartTime) / this.totalHitCount; var sampleTime = (this.profileEndTime - this.profileStartTime) / this.totalHitCount;
var keepNatives = !!WebInspector.moduleSetting("showNativeFunctionsInJSProfile").get(); var keepNatives = !!WebInspector.moduleSetting("showNativeFunctionsInJSProfile").get();
var root = nodes[0];
/** @type {!Map<number, number>} */ /** @type {!Map<number, number>} */
var idMap = new Map([[root.id, root.id]]); var idMap = new Map([[root.id, root.id]]);
var resultRoot = new WebInspector.CPUProfileNode(root, sampleTime); var resultRoot = new WebInspector.CPUProfileNode(root, sampleTime);
var parentNodeStack = root.children.map(() => resultRoot); var parentNodeStack = root.children.map(() => resultRoot);
var sourceNodeStack = root.children; var sourceNodeStack = root.children.map(id => nodeByIdMap.get(id));
while (sourceNodeStack.length) { while (sourceNodeStack.length) {
var parentNode = parentNodeStack.pop(); var parentNode = parentNodeStack.pop();
var sourceNode = sourceNodeStack.pop(); var sourceNode = sourceNodeStack.pop();
...@@ -97,7 +96,7 @@ WebInspector.CPUProfileDataModel.prototype = { ...@@ -97,7 +96,7 @@ WebInspector.CPUProfileDataModel.prototype = {
} }
idMap.set(sourceNode.id, parentNode.id); idMap.set(sourceNode.id, parentNode.id);
parentNodeStack.push.apply(parentNodeStack, sourceNode.children.map(() => parentNode)); parentNodeStack.push.apply(parentNodeStack, sourceNode.children.map(() => parentNode));
sourceNodeStack.push.apply(sourceNodeStack, sourceNode.children); sourceNodeStack.push.apply(sourceNodeStack, sourceNode.children.map(id => nodeByIdMap.get(id)));
} }
if (this.samples) if (this.samples)
this.samples = this.samples.map(id => idMap.get(id)); this.samples = this.samples.map(id => idMap.get(id));
......
...@@ -50,12 +50,10 @@ std::unique_ptr<protocol::Profiler::CPUProfileNode> buildInspectorObjectFor(v8:: ...@@ -50,12 +50,10 @@ std::unique_ptr<protocol::Profiler::CPUProfileNode> buildInspectorObjectFor(v8::
{ {
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
std::unique_ptr<protocol::Array<protocol::Profiler::CPUProfileNode>> children = protocol::Array<protocol::Profiler::CPUProfileNode>::create(); std::unique_ptr<protocol::Array<int>> children = protocol::Array<int>::create();
const int childrenCount = node->GetChildrenCount(); const int childrenCount = node->GetChildrenCount();
for (int i = 0; i < childrenCount; i++) { for (int i = 0; i < childrenCount; i++)
const v8::CpuProfileNode* child = node->GetChild(i); children->addItem(node->GetChild(i)->GetNodeId());
children->addItem(buildInspectorObjectFor(isolate, child));
}
std::unique_ptr<protocol::Array<protocol::Profiler::PositionTickInfo>> positionTicks = buildInspectorObjectForPositionTicks(node); std::unique_ptr<protocol::Array<protocol::Profiler::PositionTickInfo>> positionTicks = buildInspectorObjectForPositionTicks(node);
...@@ -94,10 +92,21 @@ std::unique_ptr<protocol::Array<double>> buildInspectorObjectForTimestamps(v8::C ...@@ -94,10 +92,21 @@ std::unique_ptr<protocol::Array<double>> buildInspectorObjectForTimestamps(v8::C
return array; return array;
} }
void flattenNodesTree(v8::Isolate* isolate, const v8::CpuProfileNode* node, protocol::Array<protocol::Profiler::CPUProfileNode>* list)
{
list->addItem(buildInspectorObjectFor(isolate, node));
const int childrenCount = node->GetChildrenCount();
for (int i = 0; i < childrenCount; i++)
flattenNodesTree(isolate, node->GetChild(i), list);
}
std::unique_ptr<protocol::Profiler::CPUProfile> createCPUProfile(v8::Isolate* isolate, v8::CpuProfile* v8profile) std::unique_ptr<protocol::Profiler::CPUProfile> createCPUProfile(v8::Isolate* isolate, v8::CpuProfile* v8profile)
{ {
std::unique_ptr<protocol::Array<protocol::Profiler::CPUProfileNode>> nodes = protocol::Array<protocol::Profiler::CPUProfileNode>::create();
flattenNodesTree(isolate, v8profile->GetTopDownRoot(), nodes.get());
std::unique_ptr<protocol::Profiler::CPUProfile> profile = protocol::Profiler::CPUProfile::create() std::unique_ptr<protocol::Profiler::CPUProfile> profile = protocol::Profiler::CPUProfile::create()
.setHead(buildInspectorObjectFor(isolate, v8profile->GetTopDownRoot())) .setNodes(std::move(nodes))
.setStartTime(static_cast<double>(v8profile->GetStartTime()) / 1000000) .setStartTime(static_cast<double>(v8profile->GetStartTime()) / 1000000)
.setEndTime(static_cast<double>(v8profile->GetEndTime()) / 1000000).build(); .setEndTime(static_cast<double>(v8profile->GetEndTime()) / 1000000).build();
profile->setSamples(buildInspectorObjectForSamples(v8profile)); profile->setSamples(buildInspectorObjectForSamples(v8profile));
......
...@@ -777,12 +777,12 @@ ...@@ -777,12 +777,12 @@
"type": "object", "type": "object",
"description": "CPU Profile node. Holds callsite information, execution statistics and child nodes.", "description": "CPU Profile node. Holds callsite information, execution statistics and child nodes.",
"properties": [ "properties": [
{ "name": "id", "type": "integer", "description": "Unique id of the node." },
{ "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." }, { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
{ "name": "hitCount", "type": "integer", "description": "Number of samples where this node was on top of the call stack." }, { "name": "hitCount", "type": "integer", "description": "Number of samples where this node was on top of the call stack." },
{ "name": "children", "type": "array", "items": { "$ref": "CPUProfileNode" }, "description": "Child nodes." }, { "name": "children", "type": "array", "items": { "type": "integer" }, "description": "Child node ids." },
{ "name": "deoptReason", "type": "string", "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."}, { "name": "deoptReason", "type": "string", "experimental": true, "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."},
{ "name": "id", "type": "integer", "description": "Unique id of the node." }, { "name": "positionTicks", "type": "array", "items": { "$ref": "PositionTickInfo" }, "experimental": true, "description": "An array of source position ticks." }
{ "name": "positionTicks", "type": "array", "items": { "$ref": "PositionTickInfo" }, "description": "An array of source position ticks." }
] ]
}, },
{ {
...@@ -790,7 +790,7 @@ ...@@ -790,7 +790,7 @@
"type": "object", "type": "object",
"description": "Profile.", "description": "Profile.",
"properties": [ "properties": [
{ "name": "head", "$ref": "CPUProfileNode" }, { "name": "nodes", "type": "array", "items": { "$ref": "CPUProfileNode" }, "description": "The list of profile nodes. First item is the root node." },
{ "name": "startTime", "type": "number", "description": "Profiling start time in seconds." }, { "name": "startTime", "type": "number", "description": "Profiling start time in seconds." },
{ "name": "endTime", "type": "number", "description": "Profiling end time in seconds." }, { "name": "endTime", "type": "number", "description": "Profiling end time in seconds." },
{ "name": "samples", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Ids of samples top nodes." }, { "name": "samples", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Ids of samples top nodes." },
...@@ -800,6 +800,7 @@ ...@@ -800,6 +800,7 @@
{ {
"id": "PositionTickInfo", "id": "PositionTickInfo",
"type": "object", "type": "object",
"experimental": true,
"description": "Specifies a number of samples attributed to a certain source position.", "description": "Specifies a number of samples attributed to a certain source position.",
"properties": [ "properties": [
{ "name": "line", "type": "integer", "description": "Source line number (1-based)." }, { "name": "line", "type": "integer", "description": "Source line number (1-based)." },
...@@ -837,7 +838,7 @@ ...@@ -837,7 +838,7 @@
"parameters": [ "parameters": [
{ "name": "id", "type": "string" }, { "name": "id", "type": "string" },
{ "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profile()." }, { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profile()." },
{ "name": "title", "type": "string", "optional": true, "description": "Profile title passed as argument to console.profile()." } { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
], ],
"description": "Sent when new profile recodring is started using console.profile() call." "description": "Sent when new profile recodring is started using console.profile() call."
}, },
...@@ -847,7 +848,7 @@ ...@@ -847,7 +848,7 @@
{ "name": "id", "type": "string" }, { "name": "id", "type": "string" },
{ "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profileEnd()." }, { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profileEnd()." },
{ "name": "profile", "$ref": "CPUProfile" }, { "name": "profile", "$ref": "CPUProfile" },
{ "name": "title", "type": "string", "optional": true, "description": "Profile title passed as argunet to console.profile()." } { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
] ]
} }
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment