Skip to content

chore(crashtracking): use RAII remote ptrace API - #2416

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
gyuheon0h/remote-ptrace-raii
Aug 25, 2026
Merged

chore(crashtracking): use RAII remote ptrace API#2416
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
gyuheon0h/remote-ptrace-raii

Conversation

@gyuheon0h

@gyuheon0h gyuheon0h commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PROF-15821

What does this PR do?

Uses RAII wrapper

  • UnwAddrSpace::new() to create address space with the ptrace accessors, and
  • UptInfo::new(tid) to create the per thread trace unwinding state

There is no need to manually manage the memory with this.

I did not use RemoteUnwindResources. It pairs one address space with one _UPT_create, so using it per thread would build a fresh address space for each thread and throw away libunwind's cached DWARF info between threads.

This will be worked on in a follow up.

Motivation

We have an RAII api. We should use it.

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@gyuheon0h gyuheon0h changed the title Use RAII remote ptrace API chore(crashtracking): use RAII remote ptrace API Aug 25, 2026
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Aug 25, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 63.64%
Overall Coverage: 76.70% (-0.00%)

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

@pr-commenter

pr-commenter Bot commented Aug 25, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-08-25 18:00:36

Comparing candidate commit 609d070 in PR branch gyuheon0h/remote-ptrace-raii with baseline commit 1766e7e in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 609d070 1787680214 gyuheon0h/remote-ptrace-raii
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2644 execution_time 3.542ms 3.581ms ± 0.030ms 3.572ms ± 0.011ms 3.587ms 3.655ms 3.682ms 3.710ms 3.88% 1.930 3.632 0.84% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2644 execution_time [3.577ms; 3.585ms] or [-0.117%; +0.117%] None None None

Baseline

Baseline benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1766e7e 1787678449 main
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2644 execution_time 3.527ms 3.575ms ± 0.030ms 3.565ms ± 0.013ms 3.584ms 3.649ms 3.659ms 3.664ms 2.79% 1.296 1.051 0.85% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2644 execution_time [3.571ms; 3.579ms] or [-0.118%; +0.118%] None None None

@gyuheon0h
gyuheon0h force-pushed the gyuheon0h/remote-ptrace-raii branch from 64dc1c2 to 609d070 Compare August 25, 2026 17:50
@gyuheon0h
gyuheon0h marked this pull request as ready for review August 25, 2026 17:53
@gyuheon0h
gyuheon0h requested a review from a team as a code owner August 25, 2026 17:53
@dd-octo-sts

dd-octo-sts Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 89.69 MB 89.69 MB +0% (+2.77 KB) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.26 MB 8.26 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.07 MB 11.07 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.91 MB 100.92 MB +0% (+2.65 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.65 MB 26.65 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 94.96 KB 94.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 180.95 MB 180.94 MB -0% (-16.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 773.55 MB 773.55 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.74 MB 8.74 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 94.96 KB 94.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.68 MB 25.68 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.15 MB 51.15 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.23 MB 23.23 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 96.45 KB 96.45 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 185.86 MB 185.84 MB -0% (-16.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 760.32 MB 760.32 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.75 MB 6.75 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 96.45 KB 96.45 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.62 MB 27.62 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.67 MB 48.67 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.96 MB 79.96 MB +0% (+2.75 KB) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.17 MB 9.17 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.67 MB 95.67 MB +0% (+2.56 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.19 MB 11.19 MB 0% (0 B) 👌

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants