Skip to content

Improve AArch64 runtime stub unwinding with precomputed per-stub unwind info - #816

Draft
jbachorik wants to merge 3 commits into
mainfrom
feat/improve_unwinding
Draft

jbachorik wants to merge 3 commits into
mainfrom
feat/improve_unwinding

Conversation

@jbachorik

@jbachorik jbachorik commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?:

Adds precomputed unwind info for AArch64 runtime stubs. The profiler decodes each stub once, at creation time (JVMTI DynamicCodeGenerated), and stores a small phase table. cstack=vm unwinding reads this table first. The old name-based rules stay as fallback.

Motivation:

VM unwinding matches stub names against a list. Names change between JDK versions and vendor builds. An unlisted stub fails to unwind and produces a break_unwind_stub_failed frame. Also, a sample that lands mid-prologue or mid-epilogue gets the wrong rule, because the old code knows only the steady state.

Additional Notes:

  • x64 is not changed. All new native code is #ifdef __aarch64__.
  • New counters: walkvm_stub_info_{classified,unclassified,hit,fallback,registration_failed}.
  • Epilogue modeling is off. Unit tests cover the on-path. The flag is ready to flip.

How to test the change?:

  • New unit tests: stubUnwindInfo_ut.cpp (42 cases, assembler-verified encodings).
  • New integration test: StubUnwindCpuTest. On aarch64 it asserts no break frames and a Java frame above each stub frame.
  • Full suites pass on macOS aarch64 (JDK 26), Linux x86_64 (JDK 26), and Linux aarch64 (JDK 21).
  • On Linux aarch64: hit=875,085, fallback=5,127. The precomputed info serves ~99.4% of stub unwinds, with no unwinding errors.

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 security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-16045

@jbachorik jbachorik added the AI label Sep 23, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #35889822996 | Commit: 2eaae59 | Duration: 16m 48s (longest job)

All 32 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 - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

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

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-09-23 16:56:08 UTC

@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 8ea6e2b8

@RetryTest(10)
@TestTemplate
@ValueSource(strings = {"vm", "vmx"})
public void testStubUnwinding(@CStack String cstack) throws Exception {
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8ea6e2b | Docs | View more details | Give us feedback!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant