Conversation
…tables Add SFrame V2 parser that transparently loads .sframe ELF sections into the existing FrameDesc* table format. When parseDwarfInfo() loads a shared library, it probes PT_GNU_SFRAME first; on success it returns early; on failure it falls through to the existing DWARF .eh_frame path. Walk-time code is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
CI Test ResultsRun: #24412572603 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-04-14 17:41:07 UTC |
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?:
Add SFrame V2 parsing as a transparent optimization in the native unwind table loading path. When the profiler loads a shared library,
parseDwarfInfo()checks for a.sframesection first viaPT_GNU_SFRAME. If present and valid, it parses the SFrame data directly into the existingFrameDesc*table. If absent or invalid, it falls back to the existing.eh_frameDWARF path. Walk-time code is completely unchanged.Motivation:
SFrame is a simpler ELF section format that directly encodes CFA/FP/RA offsets in flat, binary-searchable tables without requiring a DWARF CFI bytecode interpreter. On modern Linux distros (Fedora 43+, glibc 2.42+, binutils 2.40+), libraries ship
.sframesections alongside.eh_frame. Parsing SFrame is faster than interpreting DWARF opcodes at library load time.Additional Notes:
PT_GNU_SFRAMEis never found on Mach-O).StackWalker::walkDwarf()orCodeCache::findFrameDesc().SFrameParseris self-contained (sframe.h/sframe.cpp), depends only ondwarf.h.How to test the change?:
sframe_ut.cppcovering: header validation (magic, version, arch, truncated section, auxhdr_len), FDE loop (empty array, PCMASK skip, empty FDE skip), FRE parsing (SP/FP-based CFA, fixed/per-FRE RA, leaf functions), offset encodings (1B, 2B, 4B), multiple FDEs with sort verification, address translation with non-zero section_offset, FRE bounds overrun recovery, destructor memory safety, and aarch64 default frame detection../gradlew ddprof-test:testDebug— new SFrame tests pass, existing DWARF tests unaffected../gradlew ddprof-lib:compileRelease— builds on both Linux and macOS.cstack=dwarf, verify native stacks are collected via the SFrame path.For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!