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§
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:allocUSDT in this object file. - set_
default_ sampling_ distance - Set the default mean sample distance (bytes between samples).