Index: tools/profview/profile-utils.js |
diff --git a/tools/profview/profile-utils.js b/tools/profview/profile-utils.js |
index 9da39b1e9c07f0c84d5081b69a9df17522162a0d..de3d730eb9f639a152010bf91007a88c492373e0 100644 |
--- a/tools/profview/profile-utils.js |
+++ b/tools/profview/profile-utils.js |
@@ -130,6 +130,7 @@ function findNextFrame(file, stack, stackPos, step, filter) { |
while (stackPos >= 0 && stackPos < stack.length) { |
codeId = stack[stackPos]; |
code = codeId >= 0 ? file.code[codeId] : undefined; |
+ |
if (filter) { |
let type = code ? code.type : undefined; |
let kind = code ? code.kind : undefined; |
@@ -198,6 +199,31 @@ function createEmptyNode(name) { |
}; |
} |
+class RuntimeCallTreeProcessor { |
+ constructor() { |
+ this.tree = createEmptyNode("root"); |
+ this.tree.delayedExpansion = { frameList : [], ascending : false }; |
+ } |
+ |
+ addStack(file, tickIndex) { |
+ this.tree.ticks++; |
+ |
+ let stack = file.ticks[tickIndex].s; |
+ let i; |
+ for (i = 0; i < stack.length; i += 2) { |
+ let codeId = stack[i]; |
+ if (codeId < 0) return; |
+ let code = file.code[codeId]; |
+ if (code.type !== "CPP" && code.type !== "SHARED_LIB") { |
+ i -= 2; |
+ break; |
+ } |
+ } |
+ if (i < 0 || i >= stack.length) return; |
+ addOrUpdateChildNode(this.tree, file, tickIndex, i, false); |
+ } |
+} |
+ |
class PlainCallTreeProcessor { |
constructor(filter, isBottomUp) { |
this.filter = filter; |