[PROF-11789] Drop unknown leaf frames in VM stackwalker#394
Merged
Conversation
When native symbol resolution fails for the topmost frame, the VM stackwalker produces an "unknown" leaf. This breaks flame graph aggregation by lumping unrelated samples under a single entry. Extract the leaf-dropping logic into StackWalkValidation::dropUnknownLeaf() and call it at the end of walkVM(). Add gtest coverage for the new helper.
CI Test ResultsRun: #22309086671 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 40 | Passed: 40 | Failed: 0 Updated: 2026-02-23 14:12:29 UTC |
jbachorik
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
Implement dropping empty/unknown leaf frames. The logic is in
StackWalkValidation::dropUnknownLeaf()and gets called at the end ofwalkVM(). Unit test for that leaf-dropping logic have been added.Motivation:
When leaf-nodes in stack-traces are 'unknown' (i.e. we have no method-ID), then those get aggregated in a single bucket in the pivot table, and is rather useless. We should avoid that to improve the quality of our stack-trace reporting.
Additional Notes:
How to test the change?:
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.