FreeBSD kernel kern code
subr_stats.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/arb.h>
#include <sys/ctype.h>
#include <sys/errno.h>
#include <sys/hash.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/qmath.h>
#include <sys/sbuf.h>
#include <sys/stats.h>
#include <sys/stddef.h>
#include <sys/stdint.h>
#include <sys/time.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/rwlock.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
Include dependency graph for subr_stats.c:

Go to the source code of this file.

Data Structures

struct  voistatdata_voistate
 
struct  voistat
 
struct  voi
 
struct  statsblobv1
 
struct  statsblobv1_tpl
 
struct  sb_iter_ctx
 
struct  sb_tostrcb_ctx
 
struct  sb_visitcb_ctx
 

Macros

#define VS_VSDVALID   0x0001 /* Stat's voistatdata updated at least once. */
 
#define VS_EBITS   8
 
#define VS_INCERRS(vs)
 
#define VOI_REQSTATE   0x0001 /* VOI requires VS_STYPE_VOISTATE. */
 
#define TPL_LIST_RLOCK()   rw_rlock(&tpllistlock)
 
#define TPL_LIST_RUNLOCK()   rw_runlock(&tpllistlock)
 
#define TPL_LIST_WLOCK()   rw_wlock(&tpllistlock)
 
#define TPL_LIST_WUNLOCK()   rw_wunlock(&tpllistlock)
 
#define TPL_LIST_LOCK_ASSERT()   rw_assert(&tpllistlock, RA_LOCKED)
 
#define TPL_LIST_RLOCK_ASSERT()   rw_assert(&tpllistlock, RA_RLOCKED)
 
#define TPL_LIST_WLOCK_ASSERT()   rw_assert(&tpllistlock, RA_WLOCKED)
 
#define stats_free(ptr)   free((ptr), M_STATS)
 
#define SB_V1_MAXSZ   65535
 
#define BLOB_OFFSET(sb, off)   ((void *)(((uint8_t *)(sb)) + (off)))
 
#define NVOIS(sb)
 
#define bitsperrand   31
 

Typedefs

typedef int(* stats_v1_blob_itercb_t) (struct statsblobv1 *sb, struct voi *v, struct voistat *vs, struct sb_iter_ctx *ctx)
 

Functions

 __FBSDID ("$FreeBSD$")
 
struct statsblobv1 __aligned (sizeof(void *))
 
 _Static_assert (offsetof(struct statsblobv1, cursz)+SIZEOF_MEMBER(struct statsblobv1, cursz)==offsetof(struct statsblob, opaque), "statsblobv1 ABI mismatch")
 
 RW_SYSINIT (stats_tpl_list, &tpllistlock, "Stat template list lock")
 
 MALLOC_DEFINE (M_STATS, "stats(9) related memory", "stats(9) related memory")
 
 _Static_assert (sizeof(struct voi)==8, "statsblobv1 voi ABI mismatch")
 
static void * stats_realloc (void *ptr, size_t oldsz, size_t newsz, int flags)
 
static int stats_v1_blob_init_locked (struct statsblobv1 *sb, uint32_t tpl_id, uint32_t flags)
 
static int stats_v1_blob_expand (struct statsblobv1 **sbpp, int newvoibytes, int newvoistatbytes, int newvoistatdatabytes)
 
static void stats_v1_blob_iter (struct statsblobv1 *sb, stats_v1_blob_itercb_t icb, void *usrctx, uint32_t flags)
 
static int stats_v1_vsd_tdgst_add (enum vsd_dtype vs_dtype, struct voistatdata_tdgst *tdgst, s64q_t x, uint64_t weight, int attempt)
 
static int ctd32cmp (const struct voistatdata_tdgstctd32 *c1, const struct voistatdata_tdgstctd32 *c2)
 
 ARB_GENERATE_STATIC (ctdth32, voistatdata_tdgstctd32, ctdlnk, ctd32cmp)
 
static int ctd64cmp (const struct voistatdata_tdgstctd64 *c1, const struct voistatdata_tdgstctd64 *c2)
 
 ARB_GENERATE_STATIC (ctdth64, voistatdata_tdgstctd64, ctdlnk, ctd64cmp)
 
static sbintime_t stats_sbinuptime (void)
 
static char * stats_strdup (const char *s, int flags)
 
static void stats_tpl_update_hash (struct statsblob_tpl *tpl)
 
static uint64_t stats_pow_u64 (uint64_t base, uint64_t exp)
 
static int stats_vss_hist_bkt_hlpr (struct vss_hist_hlpr_info *info, uint32_t curbkt, struct voistatdata_numeric *bkt_lb, struct voistatdata_numeric *bkt_ub)
 
static uint32_t stats_vss_hist_nbkts_hlpr (struct vss_hist_hlpr_info *info)
 
int stats_vss_hist_hlpr (enum vsd_dtype voi_dtype, struct voistatspec *vss, struct vss_hist_hlpr_info *info)
 
int stats_vss_tdgst_hlpr (enum vsd_dtype voi_dtype, struct voistatspec *vss, struct vss_tdgst_hlpr_info *info)
 
int stats_vss_numeric_hlpr (enum vsd_dtype voi_dtype, struct voistatspec *vss, struct vss_numeric_hlpr_info *info)
 
int stats_vss_hlpr_init (enum vsd_dtype voi_dtype, uint32_t nvss, struct voistatspec *vss)
 
void stats_vss_hlpr_cleanup (uint32_t nvss, struct voistatspec *vss)
 
int stats_tpl_fetch (int tpl_id, struct statsblob_tpl **tpl)
 
int stats_tpl_fetch_allocid (const char *name, uint32_t hash)
 
int stats_tpl_id2name (uint32_t tpl_id, char *buf, size_t len)
 
int stats_tpl_sample_rollthedice (struct stats_tpl_sample_rate *rates, int nrates, void *seed_bytes, size_t seed_len)
 
int stats_v1_blob_clone (struct statsblobv1 **dst, size_t dstmaxsz, struct statsblobv1 *src, uint32_t flags)
 
int stats_v1_tpl_alloc (const char *name, uint32_t flags __unused)
 
int stats_v1_tpl_add_voistats (uint32_t tpl_id, int32_t voi_id, const char *voi_name, enum vsd_dtype voi_dtype, uint32_t nvss, struct voistatspec *vss, uint32_t flags)
 
struct statsblobv1stats_v1_blob_alloc (uint32_t tpl_id, uint32_t flags __unused)
 
void stats_v1_blob_destroy (struct statsblobv1 *sb)
 
int stats_v1_voistat_fetch_dptr (struct statsblobv1 *sb, int32_t voi_id, enum voi_stype stype, enum vsd_dtype *retdtype, struct voistatdata **retvsd, size_t *retvsdsz)
 
int stats_v1_blob_init (struct statsblobv1 *sb, uint32_t tpl_id, uint32_t flags)
 
static void stats_v1_blob_finalise (struct statsblobv1 *sb __unused)
 
static void stats_voistatdata_tdgst_tostr (enum vsd_dtype voi_dtype __unused, const struct voistatdata_tdgst *tdgst, enum vsd_dtype tdgst_dtype, size_t tdgst_dsz __unused, enum sb_str_fmt fmt, struct sbuf *buf, int objdump)
 
static void stats_voistatdata_hist_tostr (enum vsd_dtype voi_dtype, const struct voistatdata_hist *hist, enum vsd_dtype hist_dtype, size_t hist_dsz, enum sb_str_fmt fmt, struct sbuf *buf, int objdump)
 
int stats_voistatdata_tostr (const struct voistatdata *vsd, enum vsd_dtype voi_dtype, enum vsd_dtype vsd_dtype, size_t vsd_sz, enum sb_str_fmt fmt, struct sbuf *buf, int objdump)
 
static void stats_v1_itercb_tostr_freeform (struct statsblobv1 *sb, struct voi *v, struct voistat *vs, struct sb_iter_ctx *ctx)
 
static void stats_v1_itercb_tostr_json (struct statsblobv1 *sb, struct voi *v, struct voistat *vs, struct sb_iter_ctx *ctx)
 
static int stats_v1_itercb_tostr (struct statsblobv1 *sb, struct voi *v, struct voistat *vs, struct sb_iter_ctx *ctx)
 
int stats_v1_blob_tostr (struct statsblobv1 *sb, struct sbuf *buf, enum sb_str_fmt fmt, uint32_t flags)
 
static int stats_v1_itercb_visit (struct statsblobv1 *sb, struct voi *v, struct voistat *vs, struct sb_iter_ctx *ctx)
 
int stats_v1_blob_visit (struct statsblobv1 *sb, stats_blob_visitcb_t func, void *usrctx)
 
static int stats_v1_icb_reset_voistat (struct statsblobv1 *sb, struct voi *v __unused, struct voistat *vs, struct sb_iter_ctx *ctx __unused)
 
int stats_v1_blob_snapshot (struct statsblobv1 **dst, size_t dstmaxsz, struct statsblobv1 *src, uint32_t flags)
 
static int stats_v1_voi_update_max (enum vsd_dtype voi_dtype __unused, struct voistatdata *voival, struct voistat *vs, void *vsd)
 
static int stats_v1_voi_update_min (enum vsd_dtype voi_dtype __unused, struct voistatdata *voival, struct voistat *vs, void *vsd)
 
static int stats_v1_voi_update_sum (enum vsd_dtype voi_dtype __unused, struct voistatdata *voival, struct voistat *vs, void *vsd)
 
static int stats_v1_voi_update_hist (enum vsd_dtype voi_dtype, struct voistatdata *voival, struct voistat *vs, struct voistatdata_hist *hist)
 
static int stats_v1_vsd_tdgst_compress (enum vsd_dtype vs_dtype, struct voistatdata_tdgst *tdgst, int attempt)
 
static int stats_v1_voi_update_tdgst (enum vsd_dtype voi_dtype, struct voistatdata *voival, struct voistat *vs, struct voistatdata_tdgst *tdgst)
 
int stats_v1_voi_update (struct statsblobv1 *sb, int32_t voi_id, enum vsd_dtype voi_dtype, struct voistatdata *voival, uint32_t flags)
 
static void stats_init (void *arg)
 
 SYSINIT (stats, SI_SUB_KDTRACE, SI_ORDER_FIRST, stats_init, NULL)
 
static int stats_tpl_list_available (SYSCTL_HANDLER_ARGS)
 
int stats_tpl_sample_rates (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_NODE (_kern, OID_AUTO, stats, CTLFLAG_RW|CTLFLAG_MPSAFE, NULL, "stats(9) MIB")
 
 SYSCTL_PROC (_kern_stats, OID_AUTO, templates, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, stats_tpl_list_available, "A", "list the name/hash of all available stats(9) templates")
 

Variables

uint8_t abi
 
uint8_t endian
 
uint16_t flags
 
uint16_t maxsz
 
uint16_t cursz
 
uint32_t tplhash
 
uint16_t stats_off
 
uint16_t statsdata_off
 
sbintime_t created
 
sbintime_t lastrst
 
struct voi vois []
 
struct statsblobv1_tpl __aligned
 
static struct rwlock tpllistlock
 
const char * vs_stype2name [VS_NUM_STYPES]
 
const char * vs_stype2desc [VS_NUM_STYPES]
 
const char * vsd_dtype2name [VSD_NUM_DTYPES]
 
const size_t vsd_dtype2size [VSD_NUM_DTYPES]
 
static const bool vsd_compoundtype [VSD_NUM_DTYPES]
 
const struct voistatdata_numeric numeric_limits [2][VSD_DTYPE_Q_U64+1]
 
static uint32_t ntpl
 
static struct statsblob_tpl ** tpllist
 

Macro Definition Documentation

◆ bitsperrand

#define bitsperrand   31

◆ BLOB_OFFSET

#define BLOB_OFFSET (   sb,
  off 
)    ((void *)(((uint8_t *)(sb)) + (off)))

Definition at line 205 of file subr_stats.c.

◆ NVOIS

#define NVOIS (   sb)
Value:
((int32_t)((((struct statsblobv1 *)(sb))->stats_off - \
sizeof(struct statsblobv1)) >> 3))
uint16_t stats_off
Definition: subr_stats.c:7

Definition at line 212 of file subr_stats.c.

◆ SB_V1_MAXSZ

#define SB_V1_MAXSZ   65535

Definition at line 202 of file subr_stats.c.

◆ stats_free

#define stats_free (   ptr)    free((ptr), M_STATS)

Definition at line 171 of file subr_stats.c.

◆ TPL_LIST_LOCK_ASSERT

#define TPL_LIST_LOCK_ASSERT ( )    rw_assert(&tpllistlock, RA_LOCKED)

Definition at line 167 of file subr_stats.c.

◆ TPL_LIST_RLOCK

#define TPL_LIST_RLOCK ( )    rw_rlock(&tpllistlock)

Definition at line 163 of file subr_stats.c.

◆ TPL_LIST_RLOCK_ASSERT

#define TPL_LIST_RLOCK_ASSERT ( )    rw_assert(&tpllistlock, RA_RLOCKED)

Definition at line 168 of file subr_stats.c.

◆ TPL_LIST_RUNLOCK

#define TPL_LIST_RUNLOCK ( )    rw_runlock(&tpllistlock)

Definition at line 164 of file subr_stats.c.

◆ TPL_LIST_WLOCK

#define TPL_LIST_WLOCK ( )    rw_wlock(&tpllistlock)

Definition at line 165 of file subr_stats.c.

◆ TPL_LIST_WLOCK_ASSERT

#define TPL_LIST_WLOCK_ASSERT ( )    rw_assert(&tpllistlock, RA_WLOCKED)

Definition at line 169 of file subr_stats.c.

◆ TPL_LIST_WUNLOCK

#define TPL_LIST_WUNLOCK ( )    rw_wunlock(&tpllistlock)

Definition at line 166 of file subr_stats.c.

◆ VOI_REQSTATE

#define VOI_REQSTATE   0x0001 /* VOI requires VS_STYPE_VOISTATE. */

Definition at line 95 of file subr_stats.c.

◆ VS_EBITS

#define VS_EBITS   8

Definition at line 78 of file subr_stats.c.

◆ VS_INCERRS

#define VS_INCERRS (   vs)
Value:
do { \
if ((vs)->errs < (1U << VS_EBITS) - 1) \
(vs)->errs++; \
} while (0)
#define VS_EBITS
Definition: subr_stats.c:78

Definition at line 83 of file subr_stats.c.

◆ VS_VSDVALID

#define VS_VSDVALID   0x0001 /* Stat's voistatdata updated at least once. */

Definition at line 72 of file subr_stats.c.

Typedef Documentation

◆ stats_v1_blob_itercb_t

typedef int(* stats_v1_blob_itercb_t) (struct statsblobv1 *sb, struct voi *v, struct voistat *vs, struct sb_iter_ctx *ctx)

Definition at line 157 of file subr_stats.c.

Function Documentation

◆ __aligned()

struct statsblobv1 __aligned ( sizeof(void *)  )

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ _Static_assert() [1/2]

_Static_assert ( offsetof(struct statsblobv1, cursz)+SIZEOF_MEMBER(struct statsblobv1, cursz = =offsetof(struct statsblob, opaque),
"statsblobv1 ABI mismatch"   
)

◆ _Static_assert() [2/2]

_Static_assert ( sizeof(struct voi = =8,
"statsblobv1 voi ABI mismatch"   
)

◆ ARB_GENERATE_STATIC() [1/2]

ARB_GENERATE_STATIC ( ctdth32  ,
voistatdata_tdgstctd32  ,
ctdlnk  ,
ctd32cmp   
)

◆ ARB_GENERATE_STATIC() [2/2]

ARB_GENERATE_STATIC ( ctdth64  ,
voistatdata_tdgstctd64  ,
ctdlnk  ,
ctd64cmp   
)

◆ ctd32cmp()

static int ctd32cmp ( const struct voistatdata_tdgstctd32 *  c1,
const struct voistatdata_tdgstctd32 *  c2 
)
inlinestatic

Definition at line 347 of file subr_stats.c.

◆ ctd64cmp()

static int ctd64cmp ( const struct voistatdata_tdgstctd64 *  c1,
const struct voistatdata_tdgstctd64 *  c2 
)
inlinestatic

Definition at line 359 of file subr_stats.c.

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_STATS  ,
"stats(9) related memory"  ,
"stats(9) related memory"   
)

◆ RW_SYSINIT()

RW_SYSINIT ( stats_tpl_list  ,
tpllistlock,
"Stat template list lock"   
)

◆ stats_init()

static void stats_init ( void *  arg)
static

Definition at line 3681 of file subr_stats.c.

◆ stats_pow_u64()

static uint64_t stats_pow_u64 ( uint64_t  base,
uint64_t  exp 
)
inlinestatic

Definition at line 453 of file subr_stats.c.

References result.

Referenced by stats_vss_hist_bkt_hlpr().

Here is the caller graph for this function:

◆ stats_realloc()

static void * stats_realloc ( void *  ptr,
size_t  oldsz,
size_t  newsz,
int  flags 
)
inlinestatic

Definition at line 393 of file subr_stats.c.

References BLOB_OFFSET, flags, and realloc().

Referenced by stats_tpl_sample_rates(), stats_v1_blob_alloc(), stats_v1_blob_clone(), stats_v1_blob_expand(), stats_v1_tpl_add_voistats(), stats_v1_tpl_alloc(), stats_vss_hist_hlpr(), stats_vss_numeric_hlpr(), and stats_vss_tdgst_hlpr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_sbinuptime()

static sbintime_t stats_sbinuptime ( void  )
inlinestatic

Definition at line 376 of file subr_stats.c.

Referenced by stats_v1_blob_init_locked(), and stats_v1_blob_snapshot().

Here is the caller graph for this function:

◆ stats_strdup()

static char * stats_strdup ( const char *  s,
int  flags 
)
inlinestatic

Definition at line 415 of file subr_stats.c.

References flags, and malloc().

Referenced by stats_v1_tpl_add_voistats(), and stats_v1_tpl_alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_tpl_fetch()

int stats_tpl_fetch ( int  tpl_id,
struct statsblob_tpl **  tpl 
)

Definition at line 970 of file subr_stats.c.

References ntpl, TPL_LIST_WLOCK, TPL_LIST_WUNLOCK, and tpllist.

Referenced by stats_v1_blob_tostr().

Here is the caller graph for this function:

◆ stats_tpl_fetch_allocid()

int stats_tpl_fetch_allocid ( const char *  name,
uint32_t  hash 
)

Definition at line 989 of file subr_stats.c.

References name, ntpl, TPL_LIST_RLOCK, TPL_LIST_RUNLOCK, and tpllist.

Referenced by stats_tpl_sample_rates(), stats_v1_blob_tostr(), and stats_v1_tpl_alloc().

Here is the caller graph for this function:

◆ stats_tpl_id2name()

int stats_tpl_id2name ( uint32_t  tpl_id,
char *  buf,
size_t  len 
)

Definition at line 1016 of file subr_stats.c.

References buf, ntpl, TPL_LIST_RLOCK, TPL_LIST_RUNLOCK, and tpllist.

◆ stats_tpl_list_available()

static int stats_tpl_list_available ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 3691 of file subr_stats.c.

References ntpl, sbuf_data(), sbuf_delete(), sbuf_finish(), sbuf_new(), sbuf_printf(), sysctl_handle_string(), TPL_LIST_RLOCK, TPL_LIST_RUNLOCK, and tpllist.

Here is the call graph for this function:

◆ stats_tpl_sample_rates()

int stats_tpl_sample_rates ( SYSCTL_HANDLER_ARGS  )

◆ stats_tpl_sample_rollthedice()

int stats_tpl_sample_rollthedice ( struct stats_tpl_sample_rate *  rates,
int  nrates,
void *  seed_bytes,
size_t  seed_len 
)

Definition at line 1036 of file subr_stats.c.

◆ stats_tpl_update_hash()

static void stats_tpl_update_hash ( struct statsblob_tpl *  tpl)
inlinestatic

Definition at line 438 of file subr_stats.c.

References NVOIS, and TPL_LIST_WLOCK_ASSERT.

Referenced by stats_v1_tpl_add_voistats(), and stats_v1_tpl_alloc().

Here is the caller graph for this function:

◆ stats_v1_blob_alloc()

struct statsblobv1 * stats_v1_blob_alloc ( uint32_t  tpl_id,
uint32_t flags  __unused 
)

Definition at line 1378 of file subr_stats.c.

References statsblobv1::maxsz, ntpl, stats_free, stats_realloc(), stats_v1_blob_init_locked(), TPL_LIST_RLOCK, TPL_LIST_RUNLOCK, and tpllist.

Here is the call graph for this function:

◆ stats_v1_blob_clone()

int stats_v1_blob_clone ( struct statsblobv1 **  dst,
size_t  dstmaxsz,
struct statsblobv1 src,
uint32_t  flags 
)

Definition at line 1083 of file subr_stats.c.

References copyout_nofault(), cursz, flags, maxsz, src, and stats_realloc().

Referenced by stats_v1_blob_snapshot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_v1_blob_destroy()

void stats_v1_blob_destroy ( struct statsblobv1 sb)

Definition at line 1405 of file subr_stats.c.

References stats_free.

◆ stats_v1_blob_expand()

static int stats_v1_blob_expand ( struct statsblobv1 **  sbpp,
int  newvoibytes,
int  newvoistatbytes,
int  newvoistatdatabytes 
)
static

Definition at line 1476 of file subr_stats.c.

References BLOB_OFFSET, statsblobv1::cursz, voistat::data_off, voi::id, statsblobv1::maxsz, nbytes, NVOIS, SB_V1_MAXSZ, voi::stats_off, statsblobv1::stats_off, stats_realloc(), statsblobv1::statsdata_off, voistat::stype, statsblobv1::vois, and voi::voistatmaxid.

Referenced by stats_v1_tpl_add_voistats().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_v1_blob_finalise()

static void stats_v1_blob_finalise ( struct statsblobv1 *sb  __unused)
static

Definition at line 1570 of file subr_stats.c.

Referenced by stats_v1_blob_snapshot().

Here is the caller graph for this function:

◆ stats_v1_blob_init()

int stats_v1_blob_init ( struct statsblobv1 sb,
uint32_t  tpl_id,
uint32_t  flags 
)

Definition at line 1438 of file subr_stats.c.

References flags, ntpl, stats_v1_blob_init_locked(), TPL_LIST_RLOCK, and TPL_LIST_RUNLOCK.

Here is the call graph for this function:

◆ stats_v1_blob_init_locked()

static int stats_v1_blob_init_locked ( struct statsblobv1 sb,
uint32_t  tpl_id,
uint32_t flags  __unused 
)
inlinestatic

Definition at line 1456 of file subr_stats.c.

References statsblobv1::created, statsblobv1::cursz, statsblobv1::lastrst, statsblobv1::maxsz, stats_sbinuptime(), TPL_LIST_RLOCK_ASSERT, statsblobv1::tplhash, and tpllist.

Referenced by stats_v1_blob_alloc(), and stats_v1_blob_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_v1_blob_iter()

static void stats_v1_blob_iter ( struct statsblobv1 sb,
stats_v1_blob_itercb_t  icb,
void *  usrctx,
uint32_t  flags 
)
static

◆ stats_v1_blob_snapshot()

int stats_v1_blob_snapshot ( struct statsblobv1 **  dst,
size_t  dstmaxsz,
struct statsblobv1 src,
uint32_t  flags 
)

Definition at line 2472 of file subr_stats.c.

References flags, src, stats_sbinuptime(), stats_v1_blob_clone(), stats_v1_blob_finalise(), stats_v1_blob_iter(), and stats_v1_icb_reset_voistat().

Here is the call graph for this function:

◆ stats_v1_blob_tostr()

int stats_v1_blob_tostr ( struct statsblobv1 sb,
struct sbuf *  buf,
enum sb_str_fmt  fmt,
uint32_t  flags 
)

◆ stats_v1_blob_visit()

int stats_v1_blob_visit ( struct statsblobv1 sb,
stats_blob_visitcb_t  func,
void *  usrctx 
)

Definition at line 2276 of file subr_stats.c.

References statsblobv1::abi, sb_visitcb_ctx::cb, stats_v1_blob_iter(), stats_v1_itercb_visit(), and sb_visitcb_ctx::usrctx.

Here is the call graph for this function:

◆ stats_v1_icb_reset_voistat()

static int stats_v1_icb_reset_voistat ( struct statsblobv1 sb,
struct voi *v  __unused,
struct voistat vs,
struct sb_iter_ctx *ctx  __unused 
)
static

Definition at line 2293 of file subr_stats.c.

References BLOB_OFFSET, voistat::data_off, voistat::dsz, voistat::dtype, voistat::errs, voistat::flags, numeric_limits, and voistat::stype.

Referenced by stats_v1_blob_snapshot().

Here is the caller graph for this function:

◆ stats_v1_itercb_tostr()

static int stats_v1_itercb_tostr ( struct statsblobv1 sb,
struct voi v,
struct voistat vs,
struct sb_iter_ctx ctx 
)
static

Definition at line 2200 of file subr_stats.c.

References sb_tostrcb_ctx::buf, sb_tostrcb_ctx::fmt, sbuf_error(), stats_v1_itercb_tostr_freeform(), stats_v1_itercb_tostr_json(), and sb_iter_ctx::usrctx.

Referenced by stats_v1_blob_tostr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_v1_itercb_tostr_freeform()

◆ stats_v1_itercb_tostr_json()

◆ stats_v1_itercb_visit()

static int stats_v1_itercb_visit ( struct statsblobv1 sb,
struct voi v,
struct voistat vs,
struct sb_iter_ctx ctx 
)
static

◆ stats_v1_tpl_add_voistats()

int stats_v1_tpl_add_voistats ( uint32_t  tpl_id,
int32_t  voi_id,
const char *  voi_name,
enum vsd_dtype  voi_dtype,
uint32_t  nvss,
struct voistatspec *  vss,
uint32_t  flags 
)

◆ stats_v1_tpl_alloc()

◆ stats_v1_voi_update()

int stats_v1_voi_update ( struct statsblobv1 sb,
int32_t  voi_id,
enum vsd_dtype  voi_dtype,
struct voistatdata *  voival,
uint32_t  flags 
)

◆ stats_v1_voi_update_hist()

static int stats_v1_voi_update_hist ( enum vsd_dtype  voi_dtype,
struct voistatdata *  voival,
struct voistat vs,
struct voistatdata_hist *  hist 
)
inlinestatic

Definition at line 2715 of file subr_stats.c.

References voistat::dsz, voistat::dtype, voistat::flags, and VS_VSDVALID.

Referenced by stats_v1_voi_update().

Here is the caller graph for this function:

◆ stats_v1_voi_update_max()

static int stats_v1_voi_update_max ( enum vsd_dtype voi_dtype  __unused,
struct voistatdata *  voival,
struct voistat vs,
void *  vsd 
)
inlinestatic

Definition at line 2494 of file subr_stats.c.

References voistat::dtype, voistat::flags, and VS_VSDVALID.

Referenced by stats_v1_voi_update().

Here is the caller graph for this function:

◆ stats_v1_voi_update_min()

static int stats_v1_voi_update_min ( enum vsd_dtype voi_dtype  __unused,
struct voistatdata *  voival,
struct voistat vs,
void *  vsd 
)
inlinestatic

Definition at line 2578 of file subr_stats.c.

References voistat::dtype, voistat::flags, and VS_VSDVALID.

Referenced by stats_v1_voi_update().

Here is the caller graph for this function:

◆ stats_v1_voi_update_sum()

static int stats_v1_voi_update_sum ( enum vsd_dtype voi_dtype  __unused,
struct voistatdata *  voival,
struct voistat vs,
void *  vsd 
)
inlinestatic

Definition at line 2662 of file subr_stats.c.

References voistat::dtype, voistat::flags, and VS_VSDVALID.

Referenced by stats_v1_voi_update().

Here is the caller graph for this function:

◆ stats_v1_voi_update_tdgst()

static int stats_v1_voi_update_tdgst ( enum vsd_dtype  voi_dtype,
struct voistatdata *  voival,
struct voistat vs,
struct voistatdata_tdgst *  tdgst 
)
inlinestatic

Definition at line 3433 of file subr_stats.c.

References voistat::dtype, voistat::flags, stats_v1_vsd_tdgst_add(), and VS_VSDVALID.

Referenced by stats_v1_voi_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_v1_voistat_fetch_dptr()

int stats_v1_voistat_fetch_dptr ( struct statsblobv1 sb,
int32_t  voi_id,
enum voi_stype  stype,
enum vsd_dtype *  retdtype,
struct voistatdata **  retvsd,
size_t *  retvsdsz 
)

◆ stats_v1_vsd_tdgst_add()

static int stats_v1_vsd_tdgst_add ( enum vsd_dtype  vs_dtype,
struct voistatdata_tdgst *  tdgst,
s64q_t  x,
uint64_t  weight,
int  attempt 
)
inlinestatic

Definition at line 3068 of file subr_stats.c.

References panic(), printf(), and stats_v1_vsd_tdgst_compress().

Referenced by stats_v1_voi_update_tdgst(), and stats_v1_vsd_tdgst_compress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_v1_vsd_tdgst_compress()

static int stats_v1_vsd_tdgst_compress ( enum vsd_dtype  vs_dtype,
struct voistatdata_tdgst *  tdgst,
int  attempt 
)
inlinestatic

Definition at line 2910 of file subr_stats.c.

References bitsperrand, and stats_v1_vsd_tdgst_add().

Referenced by stats_v1_vsd_tdgst_add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_voistatdata_hist_tostr()

static void stats_voistatdata_hist_tostr ( enum vsd_dtype  voi_dtype,
const struct voistatdata_hist *  hist,
enum vsd_dtype  hist_dtype,
size_t  hist_dsz,
enum sb_str_fmt  fmt,
struct sbuf *  buf,
int  objdump 
)
inlinestatic

Definition at line 1766 of file subr_stats.c.

References buf, numeric_limits, sbuf_cat(), sbuf_printf(), sbuf_putc(), and stats_voistatdata_tostr().

Referenced by stats_voistatdata_tostr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_voistatdata_tdgst_tostr()

static void stats_voistatdata_tdgst_tostr ( enum vsd_dtype voi_dtype  __unused,
const struct voistatdata_tdgst *  tdgst,
enum vsd_dtype  tdgst_dtype,
size_t tdgst_dsz  __unused,
enum sb_str_fmt  fmt,
struct sbuf *  buf,
int  objdump 
)
inlinestatic

Definition at line 1635 of file subr_stats.c.

References buf, sbuf_cat(), sbuf_printf(), and sbuf_putc().

Referenced by stats_voistatdata_tostr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_voistatdata_tostr()

int stats_voistatdata_tostr ( const struct voistatdata *  vsd,
enum vsd_dtype  voi_dtype,
enum vsd_dtype  vsd_dtype,
size_t  vsd_sz,
enum sb_str_fmt  fmt,
struct sbuf *  buf,
int  objdump 
)

Definition at line 1931 of file subr_stats.c.

References buf, sbuf_cat(), sbuf_error(), sbuf_printf(), stats_voistatdata_hist_tostr(), stats_voistatdata_tdgst_tostr(), and stats_voistatdata_tostr().

Referenced by stats_v1_itercb_tostr_freeform(), stats_v1_itercb_tostr_json(), stats_voistatdata_hist_tostr(), and stats_voistatdata_tostr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_vss_hist_bkt_hlpr()

static int stats_vss_hist_bkt_hlpr ( struct vss_hist_hlpr_info *  info,
uint32_t  curbkt,
struct voistatdata_numeric *  bkt_lb,
struct voistatdata_numeric *  bkt_ub 
)
inlinestatic

Definition at line 468 of file subr_stats.c.

References stats_pow_u64().

Referenced by stats_vss_hist_hlpr(), and stats_vss_hist_nbkts_hlpr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_vss_hist_hlpr()

int stats_vss_hist_hlpr ( enum vsd_dtype  voi_dtype,
struct voistatspec *  vss,
struct vss_hist_hlpr_info *  info 
)

Definition at line 671 of file subr_stats.c.

References numeric_limits, stats_realloc(), stats_vss_hist_bkt_hlpr(), and stats_vss_hist_nbkts_hlpr().

Here is the call graph for this function:

◆ stats_vss_hist_nbkts_hlpr()

static uint32_t stats_vss_hist_nbkts_hlpr ( struct vss_hist_hlpr_info *  info)
static

Definition at line 595 of file subr_stats.c.

References stats_vss_hist_bkt_hlpr().

Referenced by stats_vss_hist_hlpr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stats_vss_hlpr_cleanup()

void stats_vss_hlpr_cleanup ( uint32_t  nvss,
struct voistatspec *  vss 
)

Definition at line 957 of file subr_stats.c.

References stats_free.

◆ stats_vss_hlpr_init()

int stats_vss_hlpr_init ( enum vsd_dtype  voi_dtype,
uint32_t  nvss,
struct voistatspec *  vss 
)

Definition at line 942 of file subr_stats.c.

◆ stats_vss_numeric_hlpr()

int stats_vss_numeric_hlpr ( enum vsd_dtype  voi_dtype,
struct voistatspec *  vss,
struct vss_numeric_hlpr_info *  info 
)

Definition at line 874 of file subr_stats.c.

References numeric_limits, stats_realloc(), and vsd_dtype2size.

Here is the call graph for this function:

◆ stats_vss_tdgst_hlpr()

int stats_vss_tdgst_hlpr ( enum vsd_dtype  voi_dtype,
struct voistatspec *  vss,
struct vss_tdgst_hlpr_info *  info 
)

Definition at line 825 of file subr_stats.c.

References stats_realloc().

Here is the call graph for this function:

◆ SYSCTL_NODE()

SYSCTL_NODE ( _kern  ,
OID_AUTO  ,
stats  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
NULL  ,
"stats(9) MIB"   
)

◆ SYSCTL_PROC()

SYSCTL_PROC ( _kern_stats  ,
OID_AUTO  ,
templates  ,
CTLTYPE_STRING|CTLFLAG_RD|  CTLFLAG_MPSAFE,
NULL  ,
,
stats_tpl_list_available  ,
"A"  ,
"list the name/hash of all available stats(9) templates"   
)

◆ SYSINIT()

SYSINIT ( stats  ,
SI_SUB_KDTRACE  ,
SI_ORDER_FIRST  ,
stats_init  ,
NULL   
)

Variable Documentation

◆ __aligned

struct statsblobv1_tpl __aligned

◆ abi

uint8_t abi

Definition at line 0 of file subr_stats.c.

◆ created

sbintime_t created

Definition at line 9 of file subr_stats.c.

Referenced by kern_jail_set().

◆ cursz

uint16_t cursz

Definition at line 4 of file subr_stats.c.

Referenced by stats_v1_blob_clone().

◆ endian

uint8_t endian

Definition at line 1 of file subr_stats.c.

◆ flags

uint16_t flags

Definition at line 2 of file subr_stats.c.

Referenced by __lockmgr_args(), _bt_fill(), _bus_dmamap_load_bio(), _bus_dmamap_load_ccb(), _bus_dmamap_load_mbuf_epg(), _bus_dmamap_load_mbuf_sg(), _bus_dmamap_load_plist(), _bus_dmamap_load_single_mbuf(), _bus_dmamap_load_uio(), _bus_dmamap_load_vlist(), _callout_init_lock(), _callout_stop_safe(), _cv_timedwait_sbt(), _cv_timedwait_sig_sbt(), _fget(), _fgetvp(), _finstall(), _mtx_init(), _rw_init_flags(), _sleep(), _vn_lock(), _vn_lock_fallback(), _vprintf(), accept1(), acl_alloc(), acl_nfs4_compute_inherited_acl_draft(), acl_nfs4_inherit_entries(), aio_biowakeup(), alq_get(), alq_getn(), alq_open_flags(), alq_post_flags(), alq_write(), alq_writen(), ast(), blist_create(), blist_resize(), breada(), breadn_flags(), bt_fill(), buf_ring_alloc(), buf_vlist_remove(), bufobj_invalbuf(), bus_alloc_resource(), bus_alloc_resources(), bus_dmamap_load(), bus_dmamap_load_bio(), bus_dmamap_load_ccb(), bus_dmamap_load_crp(), bus_dmamap_load_crp_buffer(), bus_dmamap_load_ma_triv(), bus_dmamap_load_mbuf(), bus_dmamap_load_mbuf_sg(), bus_dmamap_load_mem(), bus_dmamap_load_uio(), bus_generic_alloc_resource(), bus_generic_rl_alloc_resource(), bus_generic_setup_intr(), bus_helper_reset_post(), bus_helper_reset_prepare(), bus_helper_reset_prepare_rollback(), bus_setup_intr(), cache_enter_time_flags(), cache_symlink_alloc(), callout_cc_add(), callout_reset_sbt_on(), callout_when(), contigmalloc(), contigmalloc_domainset(), coredump(), corefile_open(), corefile_open_last(), corehdr(), counter_u64_alloc(), critical_exit_preempt(), crossmp_vop_lock1(), deferred_unmount_enqueue(), device_set_flags(), devstat_add_entry(), devstat_end_transaction(), devstat_new_entry(), do_cv_broadcast(), do_cv_signal(), do_cv_wait(), do_lock_normal(), do_lock_pi(), do_lock_pp(), do_lock_umutex(), do_rw_rdlock(), do_rw_unlock(), do_rw_wrlock(), do_sem2_wait(), do_sem2_wake(), do_set_ceiling(), do_unlock_normal(), do_unlock_pi(), do_unlock_pp(), do_unlock_umutex(), do_wake2_umutex(), do_wake_umutex(), dofileread(), dofilewrite(), domain_init(), dounmount(), each_dumpable_segment(), epoch_alloc(), eventfd_create_file(), exec_sysvec_init(), export_file_to_kinfo(), export_vnode_to_kinfo(), falloc_caps(), finstall(), finstall_refed(), firmware_get_flags(), firmware_put(), flushbuflist(), foffset_lock(), foffset_lock_uio(), foffset_unlock(), foffset_unlock_uio(), fork1(), fork_findpid(), fork_norfproc(), getblk(), getblkx(), geteblk(), hardclock_itimer(), hash_mflags(), hashinit_flags(), hexdump(), hhook_add_hook(), hhook_add_hook_lookup(), hhook_head_register(), insert_region(), intr_alloc_map_data(), intr_event_add_handler(), intr_event_create(), intr_event_update(), intr_isrc_register(), intr_setup_irq(), isrc_add_handler(), kasan_bus_space_barrier(), kasan_bus_space_map(), kcsan_bus_space_alloc(), kcsan_bus_space_barrier(), kcsan_bus_space_map(), kern___realpathat(), kern___sysctlbyname(), kern_accept4(), kern_clock_nanosleep(), kern_close_range(), kern_dup(), kern_fspacectl(), kern_getrandom(), kern_jail_get(), kern_jail_set(), kern_kldunload(), kern_kmq_open(), kern_kqueue(), kern_ktimer_settime(), kern_pipe(), kern_proc_filedesc_out(), kern_proc_out(), kern_proc_out_size(), kern_proc_vmmap_out(), kern_recvfrom(), kern_sendit(), kern_shm_open(), kern_shm_open2(), kern_sigaction(), kern_sigprocmask(), kern_syscall_helper_register(), kern_syscall_register(), kern_unmount(), kernel_mount(), kernel_sysctl(), kernel_sysctlbyname(), khelp_add_hhook(), khelp_new_hhook_registered(), kmsan_bus_space_barrier(), kmsan_bus_space_map(), kproc_create(), kproc_kthread_add(), ksem_create(), ksiginfo_alloc(), kthread_add(), ktls_buffer_import(), lf_advlockasync(), lf_hash_owner(), lf_owner_matches(), link_elf_ctf_get(), link_elf_load_file(), linker_file_unload(), linker_hints_lookup(), linker_kldload_busy(), linker_kldload_unbusy(), linker_lookup_file(), linker_search_symbol_name_flags(), LK_CAN_SHARE(), lock_init(), lockinit(), lockmgr_exit(), lockmgr_lock_flags(), lockmgr_note_exclusive_acquire(), lockmgr_note_shared_acquire(), lockmgr_slock(), lockmgr_slock_adaptive(), lockmgr_slock_hard(), lockmgr_slock_try(), lockmgr_sunlock_hard(), lockmgr_upgrade(), lockmgr_xlock(), lockmgr_xlock_hard(), lockmgr_xunlock_hard(), m_demote(), m_ether_tcpip_hash(), m_extadd(), m_get2(), m_get3(), m_getjcl(), m_getm2(), m_infiniband_tcpip_hash(), m_tcpip_hash(), m_uiotombuf(), m_uiotombuf_nomap(), make_dev_alias_p(), make_dev_alias_v(), make_dev_credf(), make_dev_credv(), make_dev_p(), make_dev_physpath_alias(), malloc(), malloc_aligned(), malloc_domain(), malloc_domainset(), malloc_domainset_aligned(), malloc_domainset_exec(), malloc_exec(), malloc_large(), mallocarray(), mallocarray_domainset(), mb_ctor_mbuf(), mb_ctor_pack(), mb_dtor_mbuf(), mi_switch(), mqfs_lookupx(), msleep_spin_sbt(), NDFREE(), needs_exclusive_leaf(), notify(), notify_create(), pause_sbt(), pget(), phashinit_flags(), physmem_dump_tables(), pic_create(), pic_lookup(), pic_lookup_locked(), prep_cdevsw(), prf_putbuf(), prf_putchar(), prison_deref(), prison_lock_xlock(), procdesc_falloc(), procdesc_new(), protect_set(), protect_setchild(), protect_setchildren(), pru_send_notsupp(), putchar(), puthdr(), qc_import(), realloc(), reallocf(), realtimer_settime(), reschedule_signals(), resource_list_alloc(), resource_list_reserve(), rman_reserve_resource(), rman_reserve_resource_bound(), runq_add(), runq_add_pri(), sbappend(), sbappend_locked(), sbappendcontrol(), sbappendcontrol_locked(), sbappendstream(), sbappendstream_locked(), sbm_clrprotoflags(), sbsetopt(), sbuf_clear_flags(), sbuf_hexdump(), sbuf_new(), sbuf_set_flags(), sched_add(), sched_preempt(), sched_switch(), sched_switch_migrate(), selflags(), selscan(), sendfile_free_mext(), sendfile_free_mext_pg(), sendfile_swapin(), sendit(), sf_buf_alloc(), shm_access(), shm_dotruncate_largepage(), shm_fspacectl(), shm_mmap(), shm_mmap_large(), shm_read(), shm_write(), size_segments(), sleeplk(), sleepq_add(), sleepq_broadcast(), sleepq_set_timeout_sbt(), sleepq_signal(), smr_advance(), smr_create(), smr_poll(), soaio_process_job(), softclock_call_cc(), soiolock(), solisten_dequeue(), soreceive_dgram(), soreceive_generic(), soreceive_rcvoob(), soreceive_stream(), sosend(), sosend_dgram(), sosend_generic(), stack_create(), stack_sbuf_print_flags(), stack_symbol(), stats_realloc(), stats_strdup(), stats_v1_blob_clone(), stats_v1_blob_init(), stats_v1_blob_iter(), stats_v1_blob_snapshot(), stats_v1_blob_tostr(), stats_v1_tpl_add_voistats(), stats_v1_voi_update(), swi_add(), swi_sched(), sx_init_flags(), sys_acct(), sys_kmq_open(), sys_ktrace(), sys_mount(), sys_nmount(), sys_procctl(), sys_shm_rename(), syscall_helper_register(), sysclock_snap2bintime(), sysctl_kern_proc(), sysctl_kern_proc_args(), sysctl_kern_proc_iterate(), sysctl_kern_proc_osrel(), sysctl_kern_proc_rlimit(), sysctl_out_proc(), TAILQ_HEAD(), taskqueue_enqueue_timeout_sbt(), tdq_add(), tdq_runq_add(), termtty_outwakeup(), threadinit(), timer2sbintime(), trans_prot(), ttcompatgetflags(), ttcompatsetflags(), ttcompatsetlflags(), tty_flush(), tty_generic_ioctl(), tty_makedevf(), tty_wakeup(), ttydisc_rint(), uipc_send(), umtx_abs_timeout_getsbt(), umtx_pi_alloc(), umtx_shm(), umtx_unlock_val(), umtxq_sleep(), unp_externalize(), untrans_prot(), user_clock_nanosleep(), userland_sysctl(), validate_uuid(), vflush(), vfs_busy(), vfs_cache_lookup(), vfs_cache_root(), vfs_cache_root_fallback(), vfs_cachedroot_sigdefer(), vfs_deferred_unmount(), vfs_fhtovp_sigdefer(), vfs_hash_get(), vfs_hash_insert(), vfs_mountroot_readconf(), vfs_periodic(), vfs_periodic_inactive(), vfs_periodic_msync_inactive(), vfs_root_sigdefer(), vfs_vget_sigdefer(), vfs_vmio_invalidate(), vfs_vmio_truncate(), vfs_write_resume(), vfs_write_suspend(), vget(), vget_finish(), vinvalbuf(), vmem_add(), vmem_alloc(), vmem_create(), vmem_import(), vmem_init(), vmem_try_fetch(), vmem_xalloc(), vmem_xalloc_nextfit(), vn_close(), vn_close1(), vn_copy_file_range(), vn_deallocate(), vn_deallocate_impl(), vn_fspacectl(), vn_generic_copy_file_range(), vn_io_fault(), vn_irflag_set_cond_locked(), vn_irflag_set_locked(), vn_irflag_unset_locked(), vn_mmap(), vn_printf(), vn_read(), vn_sendfile(), vn_start_secondary_write(), vn_start_write(), vn_start_write_refed(), vn_write(), vop_lock(), vop_stdvptocnp(), vsscanf(), vtprintf(), witness_assert(), witness_checkorder(), witness_lock(), witness_unlock(), and witness_warn().

◆ lastrst

sbintime_t lastrst

Definition at line 10 of file subr_stats.c.

◆ maxsz

uint16_t maxsz

Definition at line 3 of file subr_stats.c.

Referenced by stats_v1_blob_clone().

◆ ntpl

◆ numeric_limits

const struct voistatdata_numeric numeric_limits[2][VSD_DTYPE_Q_U64+1]
Initial value:
= {
[LIM_MIN] = {
[VSD_DTYPE_VOISTATE] = {0},
[VSD_DTYPE_INT_S32] = {.int32 = {.s32 = INT32_MIN}},
[VSD_DTYPE_INT_U32] = {.int32 = {.u32 = 0}},
[VSD_DTYPE_INT_S64] = {.int64 = {.s64 = INT64_MIN}},
[VSD_DTYPE_INT_U64] = {.int64 = {.u64 = 0}},
[VSD_DTYPE_INT_SLONG] = {.intlong = {.slong = LONG_MIN}},
[VSD_DTYPE_INT_ULONG] = {.intlong = {.ulong = 0}},
[VSD_DTYPE_Q_S32] = {.q32 = {.sq32 = Q_IFMINVAL(INT32_MIN)}},
[VSD_DTYPE_Q_U32] = {.q32 = {.uq32 = 0}},
[VSD_DTYPE_Q_S64] = {.q64 = {.sq64 = Q_IFMINVAL(INT64_MIN)}},
[VSD_DTYPE_Q_U64] = {.q64 = {.uq64 = 0}},
},
[LIM_MAX] = {
[VSD_DTYPE_VOISTATE] = {0},
[VSD_DTYPE_INT_S32] = {.int32 = {.s32 = INT32_MAX}},
[VSD_DTYPE_INT_U32] = {.int32 = {.u32 = UINT32_MAX}},
[VSD_DTYPE_INT_S64] = {.int64 = {.s64 = INT64_MAX}},
[VSD_DTYPE_INT_U64] = {.int64 = {.u64 = UINT64_MAX}},
[VSD_DTYPE_INT_SLONG] = {.intlong = {.slong = LONG_MAX}},
[VSD_DTYPE_INT_ULONG] = {.intlong = {.ulong = ULONG_MAX}},
[VSD_DTYPE_Q_S32] = {.q32 = {.sq32 = Q_IFMAXVAL(INT32_MAX)}},
[VSD_DTYPE_Q_U32] = {.q32 = {.uq32 = Q_IFMAXVAL(UINT32_MAX)}},
[VSD_DTYPE_Q_S64] = {.q64 = {.sq64 = Q_IFMAXVAL(INT64_MAX)}},
[VSD_DTYPE_Q_U64] = {.q64 = {.uq64 = Q_IFMAXVAL(UINT64_MAX)}},
}
}

Definition at line 301 of file subr_stats.c.

Referenced by stats_v1_icb_reset_voistat(), stats_voistatdata_hist_tostr(), stats_vss_hist_hlpr(), and stats_vss_numeric_hlpr().

◆ stats_off

uint16_t stats_off

Definition at line 7 of file subr_stats.c.

◆ statsdata_off

uint16_t statsdata_off

Definition at line 8 of file subr_stats.c.

◆ tplhash

uint32_t tplhash

Definition at line 6 of file subr_stats.c.

◆ tpllist

◆ tpllistlock

struct rwlock tpllistlock
static

Definition at line 161 of file subr_stats.c.

◆ vois

struct voi vois[]

Definition at line 11 of file subr_stats.c.

◆ vs_stype2desc

const char* vs_stype2desc[VS_NUM_STYPES]
Initial value:
= {
[VS_STYPE_VOISTATE] = "VOI related state data (not a real stat)",
[VS_STYPE_SUM] = "Simple arithmetic accumulator",
[VS_STYPE_MAX] = "Maximum observed VOI value",
[VS_STYPE_MIN] = "Minimum observed VOI value",
[VS_STYPE_HIST] = "Histogram of observed VOI values",
[VS_STYPE_TDGST] = "t-digest of observed VOI values",
}

Definition at line 226 of file subr_stats.c.

◆ vs_stype2name

const char* vs_stype2name[VS_NUM_STYPES]
Initial value:
= {
[VS_STYPE_VOISTATE] = "VOISTATE",
[VS_STYPE_SUM] = "SUM",
[VS_STYPE_MAX] = "MAX",
[VS_STYPE_MIN] = "MIN",
[VS_STYPE_HIST] = "HIST",
[VS_STYPE_TDGST] = "TDGST",
}

Definition at line 217 of file subr_stats.c.

Referenced by stats_v1_itercb_tostr_freeform(), and stats_v1_itercb_tostr_json().

◆ vsd_compoundtype

const bool vsd_compoundtype[VSD_NUM_DTYPES]
static
Initial value:
= {
[VSD_DTYPE_VOISTATE] = true,
[VSD_DTYPE_INT_S32] = false,
[VSD_DTYPE_INT_U32] = false,
[VSD_DTYPE_INT_S64] = false,
[VSD_DTYPE_INT_U64] = false,
[VSD_DTYPE_INT_SLONG] = false,
[VSD_DTYPE_INT_ULONG] = false,
[VSD_DTYPE_Q_S32] = false,
[VSD_DTYPE_Q_U32] = false,
[VSD_DTYPE_Q_S64] = false,
[VSD_DTYPE_Q_U64] = false,
[VSD_DTYPE_CRHIST32] = true,
[VSD_DTYPE_DRHIST32] = true,
[VSD_DTYPE_DVHIST32] = true,
[VSD_DTYPE_CRHIST64] = true,
[VSD_DTYPE_DRHIST64] = true,
[VSD_DTYPE_DVHIST64] = true,
[VSD_DTYPE_TDGSTCLUST32] = true,
[VSD_DTYPE_TDGSTCLUST64] = true,
}

Definition at line 279 of file subr_stats.c.

Referenced by stats_v1_itercb_tostr_json().

◆ vsd_dtype2name

const char* vsd_dtype2name[VSD_NUM_DTYPES]
Initial value:
= {
[VSD_DTYPE_VOISTATE] = "VOISTATE",
[VSD_DTYPE_INT_S32] = "INT_S32",
[VSD_DTYPE_INT_U32] = "INT_U32",
[VSD_DTYPE_INT_S64] = "INT_S64",
[VSD_DTYPE_INT_U64] = "INT_U64",
[VSD_DTYPE_INT_SLONG] = "INT_SLONG",
[VSD_DTYPE_INT_ULONG] = "INT_ULONG",
[VSD_DTYPE_Q_S32] = "Q_S32",
[VSD_DTYPE_Q_U32] = "Q_U32",
[VSD_DTYPE_Q_S64] = "Q_S64",
[VSD_DTYPE_Q_U64] = "Q_U64",
[VSD_DTYPE_CRHIST32] = "CRHIST32",
[VSD_DTYPE_DRHIST32] = "DRHIST32",
[VSD_DTYPE_DVHIST32] = "DVHIST32",
[VSD_DTYPE_CRHIST64] = "CRHIST64",
[VSD_DTYPE_DRHIST64] = "DRHIST64",
[VSD_DTYPE_DVHIST64] = "DVHIST64",
[VSD_DTYPE_TDGSTCLUST32] = "TDGSTCLUST32",
[VSD_DTYPE_TDGSTCLUST64] = "TDGSTCLUST64",
}

Definition at line 235 of file subr_stats.c.

Referenced by stats_v1_itercb_tostr_freeform(), and stats_v1_itercb_tostr_json().

◆ vsd_dtype2size

const size_t vsd_dtype2size[VSD_NUM_DTYPES]
Initial value:
= {
[VSD_DTYPE_VOISTATE] = sizeof(struct voistatdata_voistate),
[VSD_DTYPE_INT_S32] = sizeof(struct voistatdata_int32),
[VSD_DTYPE_INT_U32] = sizeof(struct voistatdata_int32),
[VSD_DTYPE_INT_S64] = sizeof(struct voistatdata_int64),
[VSD_DTYPE_INT_U64] = sizeof(struct voistatdata_int64),
[VSD_DTYPE_INT_SLONG] = sizeof(struct voistatdata_intlong),
[VSD_DTYPE_INT_ULONG] = sizeof(struct voistatdata_intlong),
[VSD_DTYPE_Q_S32] = sizeof(struct voistatdata_q32),
[VSD_DTYPE_Q_U32] = sizeof(struct voistatdata_q32),
[VSD_DTYPE_Q_S64] = sizeof(struct voistatdata_q64),
[VSD_DTYPE_Q_U64] = sizeof(struct voistatdata_q64),
[VSD_DTYPE_CRHIST32] = sizeof(struct voistatdata_crhist32),
[VSD_DTYPE_DRHIST32] = sizeof(struct voistatdata_drhist32),
[VSD_DTYPE_DVHIST32] = sizeof(struct voistatdata_dvhist32),
[VSD_DTYPE_CRHIST64] = sizeof(struct voistatdata_crhist64),
[VSD_DTYPE_DRHIST64] = sizeof(struct voistatdata_drhist64),
[VSD_DTYPE_DVHIST64] = sizeof(struct voistatdata_dvhist64),
[VSD_DTYPE_TDGSTCLUST32] = sizeof(struct voistatdata_tdgstclust32),
[VSD_DTYPE_TDGSTCLUST64] = sizeof(struct voistatdata_tdgstclust64),
}

Definition at line 257 of file subr_stats.c.

Referenced by stats_vss_numeric_hlpr().