Motr  M0
histogram.c File Reference
#include "lib/trace.h"
#include "ut/ut.h"
#include "addb2/histogram.h"
#include "addb2/ut/common.h"
Include dependency graph for histogram.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT
 

Functions

static void init_fini (void)
 
static void test_one (struct m0_addb2_hist *h, int64_t val)
 
static void test_around (struct m0_addb2_hist *h, int64_t val)
 
static void test_hist (struct m0_addb2_hist *h)
 
static void test_bucket (void)
 

Variables

static const int64_t minmax [][2]
 
static const int64_t random_val []
 
struct m0_ut_suite addb2_hist_ut
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT

Definition at line 22 of file histogram.c.

Function Documentation

◆ init_fini()

static void init_fini ( void  )
static

Definition at line 30 of file histogram.c.

Here is the call graph for this function:

◆ test_around()

static void test_around ( struct m0_addb2_hist h,
int64_t  val 
)
static

Definition at line 70 of file histogram.c.

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

◆ test_bucket()

static void test_bucket ( void  )
static

Definition at line 92 of file histogram.c.

Here is the call graph for this function:

◆ test_hist()

static void test_hist ( struct m0_addb2_hist h)
static

Definition at line 77 of file histogram.c.

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

◆ test_one()

static void test_one ( struct m0_addb2_hist h,
int64_t  val 
)
static

Definition at line 55 of file histogram.c.

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

Variable Documentation

◆ addb2_hist_ut

struct m0_ut_suite addb2_hist_ut
Initial value:
= {
.ts_name = "addb2-histogram",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "init-fini", &init_fini },
{ "history-bucket", &test_bucket },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_bucket(void)
Definition: histogram.c:92
static void init_fini(void)
Definition: histogram.c:30

Definition at line 105 of file histogram.c.

◆ minmax

const int64_t minmax[][2]
static
Initial value:
= {
{ 0, 1 },
{ 1, 2 },
{ -1, 0 },
{ 0, M0_BITS(58) },
{ -M0_BITS(58), 2 },
{ -M0_BITS(58), M0_BITS(58) },
{ 0, 0 }
}
#define M0_BITS(...)
Definition: misc.h:236

Definition at line 41 of file histogram.c.

◆ random_val

const int64_t random_val[]
static
Initial value:
= {
3, 5, 7, 9, 10, 11, 13, 15, 17, 1024, 1500, 60, 7776, 0xdeadbeef, 0
}

Definition at line 51 of file histogram.c.