Flow-IPC 3.0.0
Flow-IPC project: Full implementation reference.
Namespaces | Functions
stat_substrate.cpp File Reference
#include "ipc/shm/arena_lend/jemalloc/detail/stat_substrate.hpp"
#include <flow/util/util.hpp>
#include <vector>
#include <algorithm>
#include <array>
#include <cstdint>
#include <cassert>
#include <flow/util/stat/histo.hpp>

Go to the source code of this file.

Namespaces

namespace  ipc
 Catch-all namespace for the Flow-IPC project: A library/API in modern C++17 providing high-performance communication between processes.
 
namespace  ipc::shm
 Modules for SHared Memory (SHM) support.
 
namespace  ipc::shm::arena_lend
 ipc::shm sub-module providing the SHM-provider family based on the arena-lending paradigm: each process allocates in its own arena(s), lending the resulting objects to other processes, which can read them but not allocate (nor deallocate) in that arena.
 
namespace  ipc::shm::arena_lend::jemalloc
 ipc::shm sub-module with the SHM-jemalloc SHM-provider. See ipc::shm doc header for introduction.
 
namespace  ipc::shm::arena_lend::jemalloc::detail
 SHM-jemalloc internal (non-public) implementation details. See also stat-oriented sub-namespace: detail::stat.
 
namespace  ipc::shm::arena_lend::jemalloc::detail::stat
 Stats-related sub-namespace within SHM-jemalloc's detail, for general organization (and ADL segregation if needed).
 

Functions

bool ipc::shm::arena_lend::jemalloc::detail::stat::config_stats_enabled ()
 Returns whether the linked jemalloc was built with statistics support (its config.stats is true). More...
 
size_t ipc::shm::arena_lend::jemalloc::detail::stat::page_size ()
 Returns the jemalloc page size in bytes (arenas.page), read once and cached (constant for the process). More...
 
uint64_t ipc::shm::arena_lend::jemalloc::detail::stat::epoch_refresh ()
 Refreshes jemalloc's statistics snapshot (writes mallctl("epoch")), so that subsequently-read "stats.*" values reflect the present; and returns the epoch of the resulting snapshot. More...
 
uint64_t ipc::shm::arena_lend::jemalloc::detail::stat::epoch ()
 Returns jemalloc's current statistics epoch (reads mallctl("epoch")), without refreshing anything. More...
 
bool ipc::shm::arena_lend::jemalloc::detail::stat::mallctl_name_to_mib (const char *name, size_t *mib, size_t *mib_len)
 Resolves a mallctl name – which may contain integer components (e.g. More...
 
void ipc::shm::arena_lend::jemalloc::detail::stat::cumulative_alloc_dealloc_sz (arena_id_t arena_id, uint64_t *alloc_sz, uint64_t *dealloc_sz, flow::util::stat::Histogram_counter *alloc_count_by_size)
 Computes, for the given jemalloc-arena, the cumulative bytes-ever-allocated and bytes-ever-deallocated (by summing each per-size-class cumulative op-count times that size-class's byte-size), and populates a by-size-class allocation-count histogram spanning all classes (jemalloc's small bins then its large lextents, concatenated) – all in one walk over the per-size-class counters. More...