-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Taskdump viewer & expand inline frames in flamegraphs #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,22 +431,33 @@ | |
| node.count++; | ||
| for (const addr of chain) { | ||
| const entry = callframeSymbols.get(addr); | ||
| const resolved = Array.isArray(entry) ? entry[0] : entry; | ||
| const key = resolved ? resolved.symbol : addr || "??"; | ||
| const formatted = formatFrame(addr, callframeSymbols); | ||
| if (!node.children.has(key)) { | ||
| node.children.set(key, { | ||
| name: formatted.text, | ||
| fullName: key, | ||
| location: resolved ? resolved.location : null, | ||
| docsUrl: formatted.docsUrl, | ||
| children: new Map(), | ||
| count: 0, | ||
| self: 0, | ||
| }); | ||
| // Expand inlined frames. Per blazesym, an array entry is ordered | ||
| // [outermost, ..., innermost]: entry[0] is the real function at this | ||
| // address, and entry[i>0] are inlined callees (entry[0] calls entry[1] | ||
| // calls entry[2], etc.). To walk the call graph caller→callee while | ||
| // descending the flamegraph tree, iterate 0 → N. Skip nullish slots | ||
| // that can appear in sparse arrays (rare, but can happen if inline | ||
| // SymbolTableEntry events arrive before their depth=0 sibling). | ||
| const frames = Array.isArray(entry) ? entry : [entry]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it just me or is this reversing the ordering of the flamegraphs, to put the outermost deepest? That seems unintuitive if so. |
||
| for (let fi = 0; fi < frames.length; fi++) { | ||
| const resolved = frames[fi]; | ||
| if (fi > 0 && !resolved) continue; | ||
| const key = resolved ? resolved.symbol : addr || "??"; | ||
| const formatted = resolved ? formatFrame(resolved) : formatFrame(addr, callframeSymbols); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems more fragile than the old way since frames might be We could do something like: |
||
| if (!node.children.has(key)) { | ||
| node.children.set(key, { | ||
| name: formatted.text, | ||
| fullName: key, | ||
| location: resolved ? resolved.location : null, | ||
| docsUrl: formatted.docsUrl, | ||
| children: new Map(), | ||
| count: 0, | ||
| self: 0, | ||
| }); | ||
| } | ||
| node = node.children.get(key); | ||
| node.count++; | ||
| } | ||
| node = node.children.get(key); | ||
| node.count++; | ||
| } | ||
| node.self++; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit surprised not to see any changes to steering, i would have expected the schema to change at least?
Np if planned as a follow up.