File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
libdd-profiling-ffi/src/profiles
libdd-profiling/src/internal/profile Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -585,9 +585,9 @@ impl From<ProfileNewResult> for Result<Profile, Error> {
585585/// This call is _NOT_ thread-safe.
586586///
587587/// # Arguments
588- /// * `track_ptr` - If non-zero, also track this allocation for heap-live
589- /// profiling. The sample data is copied into owned storage and will be
590- /// automatically injected during profile reset. Use 0 to skip tracking.
588+ /// * `track_ptr` - If non-zero, also track this allocation for heap-live profiling. The sample data
589+ /// is copied into owned storage and will be automatically injected during profile reset. Use 0 to
590+ /// skip tracking.
591591#[ must_use]
592592#[ no_mangle]
593593pub unsafe extern "C" fn ddog_prof_Profile_add (
@@ -949,8 +949,8 @@ pub unsafe extern "C" fn ddog_prof_Profile_reset(profile: *mut Profile) -> Profi
949949/// # Arguments
950950/// * `profile` - A mutable reference to the profile.
951951/// * `max_tracked` - Maximum number of allocations to track simultaneously.
952- /// * `excluded_labels` - Label keys to strip from tracked allocations
953- /// (e.g., high-cardinality labels like "span id").
952+ /// * `excluded_labels` - Label keys to strip from tracked allocations (e.g., high-cardinality
953+ /// labels like "span id").
954954/// * `excluded_labels_len` - Number of elements in `excluded_labels`.
955955/// * `alloc_size_idx` - Index of alloc-size in the sample values array.
956956/// * `heap_live_samples_idx` - Index of heap-live-samples in the sample values array.
Original file line number Diff line number Diff line change @@ -302,7 +302,11 @@ impl Profile {
302302 // and copy sample data into owned storage before interning.
303303 if let Some ( ptr) = track_ptr {
304304 if let Some ( hl) = self . heap_live . as_mut ( ) {
305- let storage = self . string_storage . as_ref ( ) . unwrap ( ) ;
305+ let storage = self . string_storage . as_ref ( ) . ok_or_else ( || {
306+ anyhow:: anyhow!(
307+ "string storage required for heap-live tracking with string IDs"
308+ )
309+ } ) ?;
306310 let locked = storage
307311 . lock ( )
308312 . map_err ( |_| anyhow:: anyhow!( "string storage lock was poisoned" ) ) ?;
@@ -388,8 +392,8 @@ impl Profile {
388392 ///
389393 /// # Arguments
390394 /// * `max_tracked` - Maximum number of allocations to track simultaneously
391- /// * `excluded_labels` - Label keys to strip when copying into the tracker
392- /// (e.g., high-cardinality labels like "span id", "trace id")
395+ /// * `excluded_labels` - Label keys to strip when copying into the tracker (e.g.,
396+ /// high-cardinality labels like "span id", "trace id")
393397 pub fn enable_heap_live_tracking (
394398 & mut self ,
395399 max_tracked : usize ,
You can’t perform that action at this time.
0 commit comments