feat(profiling): Wrap libunwind in a crate#1510
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 21 commits intomainfrom Mar 5, 2026
Merged
feat(profiling): Wrap libunwind in a crate#1510gh-worker-dd-mergequeue-cf854d[bot] merged 21 commits intomainfrom
gh-worker-dd-mergequeue-cf854d[bot] merged 21 commits intomainfrom
Conversation
7067a18 to
b6f74b9
Compare
BenchmarksComparisonBenchmark execution time: 2026-03-05 13:40:15 Comparing candidate commit ad90dd5 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 57 metrics, 2 unstable metrics. CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1510 +/- ##
==========================================
+ Coverage 71.22% 71.26% +0.03%
==========================================
Files 425 427 +2
Lines 62695 62782 +87
==========================================
+ Hits 44657 44740 +83
- Misses 18038 18042 +4
🚀 New features to boost your workflow:
|
55827cb to
6097468
Compare
be0502f to
6e903c9
Compare
Contributor
|
Should this be a public libunwind-sys crate? |
b406281 to
fa7cdd1
Compare
fa7cdd1 to
ddb53cb
Compare
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
03c4be1 to
aef4c41
Compare
Contributor
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
d53d36c to
3713768
Compare
e69c591 to
ba13f15
Compare
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
that referenced
this pull request
Mar 9, 2026
# What does this PR do? Use packaged libunwind to unwind crash stacktrace. The diff is bigger than the actual change, because I moved some of the emitter functions around so that the file structure is ``` helper structs main emit func (`emit_crashreport`) ... all the helper emitters ... ``` I also added `unsafe` comments to unsafe calls # Motivation Crashtracker collects callstacks. When it comes to alpine/musl-libc (mainly on x86_64), we fail at retrieving the callstack passed the signal frame. The problem is that the musl-libc binary does not have the CFIs (unwinding information) and the unwinder does not know how to move forward and stop. Libunwind provides a way to unwind starting from the ucontext: context (registers and state) of the crashing thread. Going that way, we can collect the callstack as much as possible (until hitting musl-libc). We previously packaged libunwind as a libdatadog crate here: [feat(profiling): Wrap libunwind in a crate](#1510) Lets use this to unwind from crash ucontext # Additional Notes Anything else we should know when reviewing? # How to test the change? Describe here in detail how the change can be validated. Co-authored-by: gyuheon.oh <[email protected]>
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
to DataDog/dd-trace-py
that referenced
this pull request
Mar 18, 2026
## Description Latest versions of `libdatadog` build `libunwind` from source, which requires having `autoconf` and `automake` available in the env that builds it. See DataDog/libdatadog#1510. Co-authored-by: thomas.kowalski <[email protected]>
brettlangdon
pushed a commit
to DataDog/dd-trace-py
that referenced
this pull request
Mar 23, 2026
## Description Latest versions of `libdatadog` build `libunwind` from source, which requires having `autoconf` and `automake` available in the env that builds it. See DataDog/libdatadog#1510. Co-authored-by: thomas.kowalski <[email protected]>
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?
Wrap libunwind in
libdd-libunwind-sysRust crate.Motivation
Crashtracker collects callstacks. When it comes to alpine/musl-libc (mainly on x86_64), we fail at retrieving the callstack passed the signal frame. The problem is that the musl-libc binary does not have the CFIs (unwinding information) and the unwinder does not know how to move forward and stop.
Libunwind provides a way to unwind starting from the ucontext: context (registers and state) of the crashing thread. Going that way, we can collect the callstack as much as possible (until hitting musl-libc)
Additional Notes
Gitlab jobs have been modified in this PR and it's working https://gitlab.ddbuild.io/DataDog/apm-reliability/libddprof-build/-/pipelines/100326074.