Skip to main content

Crate libdd_profiling_heap_sampler

Crate libdd_profiling_heap_sampler 

Source
Expand description

Rust bindings for the libdd-profiling-heap-sampler C library.

FFI declarations and #[repr(C)] struct mirrors are generated by bindgen from the public headers under include/datadog/heap/ at build time; see build.rs. All items are re-exported at the crate root.

The static inline __attribute__((always_inline)) fast-path helpers in the headers have no linker symbol, so bindgen’s wrap_static_fns emits a C shim for each - the shim’s body is the static-inline inlined at its one call site. The shim’s link-symbol is <fn>__extern, but bindgen exposes the Rust fn under the natural C name via #[link_name], so callers write dd_allocation_requested(…) the same way they would in C.

Structs§

dd_alloc_freed_t
dd_alloc_req_t
dd_realloc_prep_t
dd_tl_state_t

Constants§

DD_HEAP_SAMPLING_ENABLED
Name of the environment variable that toggles heap sampling.
DD_SAMPLING_INTERVAL_DEFAULT
dd_realloc_kind_t_DD_REALLOC_KIND_ALLOC
dd_realloc_kind_t_DD_REALLOC_KIND_FREE
dd_realloc_kind_t_DD_REALLOC_KIND_PASSTHROUGH
dd_realloc_kind_t_DD_REALLOC_KIND_SAMPLED

Functions§

dd_alloc_req_is_sampled⚠
dd_allocation_created⚠
dd_allocation_created_slow⚠
dd_allocation_freed⚠
dd_allocation_freed_slow⚠
dd_allocation_realloc_commit⚠
dd_allocation_realloc_prepare⚠
dd_allocation_requested⚠
dd_allocation_requested_slow⚠
dd_heap_profiler_attached⚠
dd_probe_alloc⚠
dd_probe_free⚠
dd_sample_flag_apply⚠
dd_sample_flag_check_and_clear⚠
dd_sample_flag_peek⚠
dd_sample_flag_thread_init⚠
dd_sampling_interval_effective⚠
dd_set_default_sampling_interval⚠
dd_test_set_profiler_active⚠
dd_tl_state_get⚠
dd_tl_state_get_or_init⚠
dd_tl_state_init⚠
heap_sampling_enabled
Whether heap sampling is enabled for this process. Users of this library can use this to check if they should setup allocation tracking or not.
is_profiler_attached
Returns true when an external profiler is currently attached to the ddheap:alloc USDT in this object file.
set_default_sampling_distance
Set the default mean sample distance (bytes between samples).

Type Aliases§

dd_realloc_kind_t