You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Adds supporting FFI infrastructure for the profiling library, including:
ArcHandle<T>: Generic wrapper for exposing libdd-profiling's Arc<T> across FFI boundaries.
ProfileStatus: FFI-safe status/result type for error handling.
ProfileError: Structured error types with FFI-safe string formatting. Basically, a more Rust-ergonomic ProfileStatus with convenient conversions from many error types.
Utf8Option: UTF-8 validation options for string handling, which will be used in the ProfilesDictionary FFI methods.
FallibleStringWriter: Utility for formatting errors into strings, accounting for allocation failures.
Motivation
This lays the groundwork for upcoming FFI enhancements, specifically:
ProfilesDictionary FFI bindings (next PR).
New ddog_prof_Profile_add2 API (after that).
Additional Notes
No existing functionality is changed; this is purely additive.
No FFI functions are exported yet; these are internal building blocks that I split out because the PR was getting too large.
How to test the change?
Build and test the profiling and profiling FFI libraries:
cargo test -p "libdd-profiling" -p "libdd-profiling-ffi" --lib
morrisonlevi
changed the title
Levi/generic ffi infrastructure
feat(profiling-ffi): ProfileStatus, ProfileError, and more supporting types
Dec 13, 2025
❌ Patch coverage is 73.58121% with 135 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.18%. Comparing base (73c675b) to head (b3b3164).
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?
Adds supporting FFI infrastructure for the profiling library, including:
ArcHandle<T>: Generic wrapper for exposinglibdd-profiling'sArc<T>across FFI boundaries.ProfileStatus: FFI-safe status/result type for error handling.ProfileError: Structured error types with FFI-safe string formatting. Basically, a more Rust-ergonomicProfileStatuswith convenient conversions from many error types.Utf8Option: UTF-8 validation options for string handling, which will be used in theProfilesDictionaryFFI methods.FallibleStringWriter: Utility for formatting errors into strings, accounting for allocation failures.Motivation
This lays the groundwork for upcoming FFI enhancements, specifically:
ddog_prof_Profile_add2API (after that).Additional Notes
How to test the change?
Build and test the profiling and profiling FFI libraries: