Motr  M0
Unit Benchmarking.

Data Structures

struct  m0_ub_bench
 
struct  m0_ub_set
 

Macros

#define M0_UB_ASSERT(cond)   M0_ASSERT(cond)
 

Enumerations

enum  { M0_UB_SET_BENCHMARKS_MAX = 32 }
 

Functions

M0_INTERNAL void m0_ub_set_print (void)
 
M0_INTERNAL int m0_ub_set_select (const char *name)
 
M0_INTERNAL void m0_ub_set_add (struct m0_ub_set *set)
 
static void timeval_norm (struct timeval *t)
 
static void timeval_diff (const struct timeval *start, const struct timeval *end, struct timeval *diff)
 
static double delay (const struct timeval *start, const struct timeval *end)
 
static void ub_run_one (const struct m0_ub_set *set, struct m0_ub_bench *bench)
 
static uint64_t bw (uint64_t bytes, m0_time_t time)
 
static void results_print (uint32_t round)
 
M0_INTERNAL int m0_ub_run (uint32_t rounds, const char *opts)
 

Variables

static struct m0_ub_setlast = NULL
 

Detailed Description

Macro Definition Documentation

◆ M0_UB_ASSERT

#define M0_UB_ASSERT (   cond)    M0_ASSERT(cond)

Definition at line 37 of file ub.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_UB_SET_BENCHMARKS_MAX 

Definition at line 69 of file ub.h.

Function Documentation

◆ bw()

static uint64_t bw ( uint64_t  bytes,
m0_time_t  time 
)
static

Definition at line 137 of file ub.c.

Here is the caller graph for this function:

◆ delay()

static double delay ( const struct timeval *  start,
const struct timeval *  end 
)
static

Definition at line 100 of file ub.c.

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

◆ m0_ub_run()

M0_INTERNAL int m0_ub_run ( uint32_t  rounds,
const char *  opts 
)

Runs unit sets unit benchmark consists of.

Parameters
roundsNumber of times every set in benchark has to be run.
optsOptional string with benchmark arguments, specified via ‘-o’ CLI option.
See also
ub_args_parse()

Definition at line 182 of file ub.c.

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

◆ m0_ub_set_add()

M0_INTERNAL void m0_ub_set_add ( struct m0_ub_set set)

Adds given unit set into the unit benchmark.

Definition at line 69 of file ub.c.

Here is the caller graph for this function:

◆ m0_ub_set_print()

M0_INTERNAL void m0_ub_set_print ( void  )

Prints names of all available benchmarks.

Definition at line 45 of file ub.c.

Here is the caller graph for this function:

◆ m0_ub_set_select()

M0_INTERNAL int m0_ub_set_select ( const char *  name)

Selects one unit set from the unit benchmark to run.

Parameters
nameName of the unit set to run.

0 Unit set has been selected successfully. -ENOENT Unit set with given name is not found.

Definition at line 54 of file ub.c.

Here is the caller graph for this function:

◆ results_print()

static void results_print ( uint32_t  round)
static

Definition at line 142 of file ub.c.

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

◆ timeval_diff()

static void timeval_diff ( const struct timeval *  start,
const struct timeval *  end,
struct timeval *  diff 
)
static

Definition at line 91 of file ub.c.

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

◆ timeval_norm()

static void timeval_norm ( struct timeval *  t)
static

Definition at line 79 of file ub.c.

Here is the caller graph for this function:

◆ ub_run_one()

static void ub_run_one ( const struct m0_ub_set set,
struct m0_ub_bench bench 
)
static

Definition at line 109 of file ub.c.

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

Variable Documentation

◆ last

struct m0_ub_set* last = NULL
static

Definition at line 43 of file ub.c.