From afc8c188c556ca12c970a810ab7c51d864b293ac Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sun, 16 Aug 2026 12:18:20 -0500 Subject: [PATCH] Fix frame presentation to base function at the bottom of the view. --- src/SeerParallelStacksCommon.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/SeerParallelStacksCommon.cpp b/src/SeerParallelStacksCommon.cpp index 29ee90d..1e6af1f 100644 --- a/src/SeerParallelStacksCommon.cpp +++ b/src/SeerParallelStacksCommon.cpp @@ -206,19 +206,26 @@ SeerParallelStacksStack SeerParallelStacksFillStack(const SeerParallelStacksNode stack.threadIds.append(t.id()); } - if (node.function.function().isEmpty() == false) { - stack.frames.append(node.function); - } - if (node.children.size() == 1) { // Merge single child into this stack (chain of frames). // 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]); - stack.frames += child.frames; - stack.stacks = child.stacks; - stack.threadCount = child.threadCount; - stack.threadIds = child.threadIds; + stack.frames = child.frames; + stack.stacks = child.stacks; + stack.threadCount = child.threadCount; + stack.threadIds = child.threadIds; + + if (node.function.function().isEmpty() == false) { + stack.frames.append(node.function); + } } else { + if (node.function.function().isEmpty() == false) { + stack.frames.append(node.function); + } + for (const auto& childNode : node.children) { stack.stacks.append(SeerParallelStacksFillStack(childNode)); }