histogram_data.h File Reference

Generic histogram library. More...

Data Structures

struct  spdk_histogram_data
 

Macros

#define SPDK_HISTOGRAM_BUCKET_SHIFT_DEFAULT   7
 
#define SPDK_HISTOGRAM_BUCKET_SHIFT(h)   h->bucket_shift
 
#define SPDK_HISTOGRAM_BUCKET_LSB(h)   (64 - SPDK_HISTOGRAM_BUCKET_SHIFT(h))
 
#define SPDK_HISTOGRAM_NUM_BUCKETS_PER_RANGE(h)   (1ULL << SPDK_HISTOGRAM_BUCKET_SHIFT(h))
 
#define SPDK_HISTOGRAM_BUCKET_MASK(h)   (SPDK_HISTOGRAM_NUM_BUCKETS_PER_RANGE(h) - 1)
 
#define SPDK_HISTOGRAM_NUM_BUCKET_RANGES(h)   (SPDK_HISTOGRAM_BUCKET_LSB(h) + 1)
 
#define SPDK_HISTOGRAM_NUM_BUCKETS(h)
 

Typedefs

typedef void(* spdk_histogram_data_fn) (void *ctx, uint64_t start, uint64_t end, uint64_t count, uint64_t total, uint64_t so_far)
 

Functions

static void __spdk_histogram_increment (struct spdk_histogram_data *h, uint32_t range, uint32_t index)
 
static uint64_t __spdk_histogram_get_count (const struct spdk_histogram_data *h, uint32_t range, uint32_t index)
 
static uint64_t * __spdk_histogram_get_bucket (const struct spdk_histogram_data *h, uint32_t range, uint32_t index)
 
static void spdk_histogram_data_reset (struct spdk_histogram_data *histogram)
 
static uint32_t __spdk_histogram_data_get_bucket_range (struct spdk_histogram_data *h, uint64_t datapoint)
 
static uint32_t __spdk_histogram_data_get_bucket_index (struct spdk_histogram_data *h, uint64_t datapoint, uint32_t range)
 
static void spdk_histogram_data_tally (struct spdk_histogram_data *histogram, uint64_t datapoint)
 
static uint64_t __spdk_histogram_data_get_bucket_start (const struct spdk_histogram_data *h, uint32_t range, uint32_t index)
 
static void spdk_histogram_data_iterate (const struct spdk_histogram_data *histogram, spdk_histogram_data_fn fn, void *ctx)
 
static void spdk_histogram_data_merge (const struct spdk_histogram_data *dst, const struct spdk_histogram_data *src)
 
static struct spdk_histogram_dataspdk_histogram_data_alloc_sized (uint32_t bucket_shift)
 
static struct spdk_histogram_dataspdk_histogram_data_alloc (void)
 
static void spdk_histogram_data_free (struct spdk_histogram_data *h)
 

Detailed Description

Generic histogram library.

Macro Definition Documentation

◆ SPDK_HISTOGRAM_NUM_BUCKETS

#define SPDK_HISTOGRAM_NUM_BUCKETS (   h)
Value:
(SPDK_HISTOGRAM_NUM_BUCKETS_PER_RANGE(h) * \
SPDK_HISTOGRAM_NUM_BUCKET_RANGES(h))