Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: tools/profview/profile-utils.js

Issue 2811953003: [profview] Add runtime-entry top-down tree. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/profview/profview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | tools/profview/profview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698