Fix frame presentation to base function at the bottom of the view.

This commit is contained in:
Ernie Pasveer
2026-08-16 12:18:20 -05:00
parent ddc7245125
commit afc8c188c5
+15 -8
View File
@@ -206,19 +206,26 @@ SeerParallelStacksStack SeerParallelStacksFillStack(const SeerParallelStacksNode
stack.threadIds.append(t.id()); stack.threadIds.append(t.id());
} }
if (node.function.function().isEmpty() == false) {
stack.frames.append(node.function);
}
if (node.children.size() == 1) { if (node.children.size() == 1) {
// Merge single child into this stack (chain of frames). // Merge single child into this stack (chain of frames).
// Keep the IDs from the leaf (most specific) node. // Keep the IDs from the leaf (most specific) node.
// Children are deeper (more toward the top of the call stack) than
// this node, so their frames go first — the resulting list reads
// top of stack (innermost) to bottom of stack (outermost).
auto child = SeerParallelStacksFillStack(node.children[0]); auto child = SeerParallelStacksFillStack(node.children[0]);
stack.frames += child.frames; stack.frames = child.frames;
stack.stacks = child.stacks; stack.stacks = child.stacks;
stack.threadCount = child.threadCount; stack.threadCount = child.threadCount;
stack.threadIds = child.threadIds; stack.threadIds = child.threadIds;
if (node.function.function().isEmpty() == false) {
stack.frames.append(node.function);
}
} else { } else {
if (node.function.function().isEmpty() == false) {
stack.frames.append(node.function);
}
for (const auto& childNode : node.children) { for (const auto& childNode : node.children) {
stack.stacks.append(SeerParallelStacksFillStack(childNode)); stack.stacks.append(SeerParallelStacksFillStack(childNode));
} }