Expand description
Exact DHAT v2 heap/lifetime profiling controls.
DHAT records every non-internal allocation from the moment start
succeeds.
It is intended for short diagnostic runs and tests rather than continuous production
telemetry. The generated JSON opens in the standard Valgrind dh_view.html viewer.
It is independent of sampled prof profiling and of mi_memory_set_callbacks.
Requires the opt-in dhat cargo feature (C MI_DHAT=1; off by default, enable it with
features = ["dhat"]). Without it the observer
is compiled out of the allocator, the API stays present for source compatibility, and
start returns false, is_enabled and
Stats::enabled are false, and dump_file returns an error.
Structs§
- Stats
- Snapshot of exact DHAT collector state.
Functions§
- dump_
file - Serialize the current or stopped measurement window as a DHAT v2 JSON file.
- is_
enabled - Whether exact DHAT tracking is currently active.
- start
- Start exact allocation/lifetime tracking. Returns
falseif it is already active, or if the crate was built without thedhatfeature. - stats
- Read the collector’s exact counters. Returns a zero/default snapshot only if the
linked C library rejected the versioned ABI structure, or if the crate was built
without the
dhatfeature. - stop
- Stop observing allocation events. Retained records remain available to
dump_fileso a caller can stop a measurement window before serializing its report.