template <size_t BufferLength, size_t Capacity, size_t BucketCount>
class HeapProfileMap
Defined at line 178 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h
Fixed-size lookup table tha links code path to its memory usage statistics.
Template arguments:
BufferLength: length of the buffer holding `Header`, `Value` and backtraces.
Must be a multiple of kPageSize.
Capacity: the maximum number of 'Entry' that can be stored in the
hashmap.
BucketCount: number of bucket for the hashmap. Must be smaller than
EntryCapacity.
Public Methods
void HeapProfileMap<BufferLength, Capacity, BucketCount> ()
Defined at line 180 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h
void ~HeapProfileMap<BufferLength, Capacity, BucketCount> ()
Defined at line 183 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h
std::tuple<Counters *, size_t> try_get (std::span<const zx_vaddr_t> backtrace)
Gets or creates `Counters` for a given allocation backtrace.
Upon success, returns a pointer to the `Counters` and the offset for that instance to be used
with `try_by_handle` for future retrieval.
When the capacity is reached, the creation fails and {nullptr, 0} is returned.
Defined at line 189 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h
std::span<const uint8_t> data ()
Pointer to the buffer holding a live memory profile exposed to userspace.
The buffer is page aligned.
Defined at line 201 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h
void event_dropped ()
Increases the count of event dropped.
Defined at line 204 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h
Counters * try_by_handle (size_t handle)
Returns a pointer to the counters at the given offset, or nullptr if
the offset overflows.
Defined at line 212 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h