Skip to content

Comments

[PROF-11789] Drop unknown leaf frames in VM stackwalker#394

Merged
rkennke merged 1 commit intomainfrom
PROF-11789
Feb 24, 2026
Merged

[PROF-11789] Drop unknown leaf frames in VM stackwalker#394
rkennke merged 1 commit intomainfrom
PROF-11789

Conversation

@rkennke
Copy link
Contributor

@rkennke rkennke commented Feb 23, 2026

What does this PR do?:
Implement dropping empty/unknown leaf frames. The logic is in StackWalkValidation::dropUnknownLeaf() and gets called at the end of walkVM(). 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?:

  • 6 new unit-tests have been added that cover the leaf-dropping logic

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: PROF-11789

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.
@rkennke rkennke requested a review from a team as a code owner February 23, 2026 13:54
@rkennke rkennke marked this pull request as draft February 23, 2026 13:54
@dd-octo-sts
Copy link

dd-octo-sts bot commented Feb 23, 2026

CI Test Results

Run: #22309086671 | Commit: f391d8f | Duration: 13m 57s (longest job)

All 40 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
8-zing - -
11 - - -
11-j9 - -
11-librca - -
11-zing - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
17-zing - -
21 - -
21-graal - -
21-librca - -
21-zing - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 40 | Passed: 40 | Failed: 0


Updated: 2026-02-23 14:12:29 UTC

@rkennke rkennke marked this pull request as ready for review February 24, 2026 08:20
@rkennke rkennke merged commit b3c89da into main Feb 24, 2026
192 of 193 checks passed
@rkennke rkennke deleted the PROF-11789 branch February 24, 2026 09:04
@github-actions github-actions bot added this to the 1.38.0 milestone Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants