Motr  M0
dtm0_log_ut.c File Reference
#include "be/dtm0_log.h"
#include "be/list.h"
#include "be/tx.h"
#include "be/tx_credit.h"
#include "be/ut/helper.h"
#include "dtm0/clk_src.h"
#include "dtm0/tx_desc.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/trace.h"
#include "ut/ut.h"
Include dependency graph for dtm0_log_ut.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM
 

Enumerations

enum  { UT_DTM0_LOG_MAX_PA = 3, UT_DTM0_LOG_BUF_SIZE = 256, UT_DTM0_LOG_MAX_LOG_REC = 10 }
 

Functions

static void p_state_set (struct m0_dtm0_tx_pa *pa, uint32_t state)
 
static void p_init (struct m0_dtm0_tx_pa *pa, int rand)
 
static bool p_check (const struct m0_dtm0_tx_pa *pa, int rand)
 
static void tid_init (struct m0_dtm0_tid *tid, int rand)
 
static bool tid_check (const struct m0_dtm0_tid *tid, int rand)
 
static int txd_init (struct m0_dtm0_tx_desc *txd, int rand)
 
static void txd_fini (struct m0_dtm0_tx_desc *txd)
 
static bool txd_check (const struct m0_dtm0_tx_desc *txd, int rand)
 
static int ut_dl_init_buf (struct m0_buf *buf, int rand)
 
static void ut_dl_fini_buf (struct m0_buf *buf)
 
static bool ut_dl_verify_buf (struct m0_buf *buf, int rand)
 
static int ut_dl_init (struct m0_dtm0_tx_desc *txd, struct m0_buf *buf, int rand)
 
static void ut_dl_fini (struct m0_dtm0_tx_desc *txd, struct m0_buf *buf)
 
static bool ut_dl_verify_log_rec (struct m0_dtm0_log_rec *rec, int rand)
 
void test_volatile_dtm0_log (void)
 
static struct m0_be_dtm0_logpersistent_log_create (void)
 
static void persistent_log_destroy (struct m0_be_dtm0_log *log)
 
static void persistent_log_operate (struct m0_be_dtm0_log *log)
 
static void dtm0_log_check (const struct m0_be_dtm0_log *log)
 
static void m0_be_ut_dtm0_log_test (void)
 

Variables

static struct m0_be_ut_backendut_be
 
static struct m0_be_ut_segut_seg
 
static struct m0_be_segseg
 
struct m0_ut_suite dtm0_log_ut
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM

Definition at line 22 of file dtm0_log_ut.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UT_DTM0_LOG_MAX_PA 
UT_DTM0_LOG_BUF_SIZE 
UT_DTM0_LOG_MAX_LOG_REC 

Definition at line 36 of file dtm0_log_ut.c.

Function Documentation

◆ dtm0_log_check()

static void dtm0_log_check ( const struct m0_be_dtm0_log log)
static

Definition at line 564 of file dtm0_log_ut.c.

Here is the caller graph for this function:

◆ m0_be_ut_dtm0_log_test()

static void m0_be_ut_dtm0_log_test ( void  )
static

Definition at line 568 of file dtm0_log_ut.c.

Here is the call graph for this function:

◆ p_check()

static bool p_check ( const struct m0_dtm0_tx_pa pa,
int  rand 
)
static

Definition at line 55 of file dtm0_log_ut.c.

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

◆ p_init()

static void p_init ( struct m0_dtm0_tx_pa pa,
int  rand 
)
static

Definition at line 49 of file dtm0_log_ut.c.

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

◆ p_state_set()

static void p_state_set ( struct m0_dtm0_tx_pa pa,
uint32_t  state 
)
static

Definition at line 44 of file dtm0_log_ut.c.

Here is the caller graph for this function:

◆ persistent_log_create()

static struct m0_be_dtm0_log* persistent_log_create ( void  )
static

Definition at line 294 of file dtm0_log_ut.c.

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

◆ persistent_log_destroy()

static void persistent_log_destroy ( struct m0_be_dtm0_log log)
static

Definition at line 331 of file dtm0_log_ut.c.

Here is the caller graph for this function:

◆ persistent_log_operate()

static void persistent_log_operate ( struct m0_be_dtm0_log log)
static

Definition at line 335 of file dtm0_log_ut.c.

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

◆ test_volatile_dtm0_log()

void test_volatile_dtm0_log ( void  )

Definition at line 169 of file dtm0_log_ut.c.

Here is the call graph for this function:

◆ tid_check()

static bool tid_check ( const struct m0_dtm0_tid tid,
int  rand 
)
static

Definition at line 73 of file dtm0_log_ut.c.

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

◆ tid_init()

static void tid_init ( struct m0_dtm0_tid tid,
int  rand 
)
static

Definition at line 67 of file dtm0_log_ut.c.

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

◆ txd_check()

static bool txd_check ( const struct m0_dtm0_tx_desc txd,
int  rand 
)
static

Definition at line 106 of file dtm0_log_ut.c.

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

◆ txd_fini()

static void txd_fini ( struct m0_dtm0_tx_desc txd)
static

Definition at line 101 of file dtm0_log_ut.c.

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

◆ txd_init()

static int txd_init ( struct m0_dtm0_tx_desc txd,
int  rand 
)
static

Definition at line 84 of file dtm0_log_ut.c.

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

◆ ut_dl_fini()

static void ut_dl_fini ( struct m0_dtm0_tx_desc txd,
struct m0_buf buf 
)
static

Definition at line 156 of file dtm0_log_ut.c.

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

◆ ut_dl_fini_buf()

static void ut_dl_fini_buf ( struct m0_buf buf)
static

Definition at line 124 of file dtm0_log_ut.c.

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

◆ ut_dl_init()

static int ut_dl_init ( struct m0_dtm0_tx_desc txd,
struct m0_buf buf,
int  rand 
)
static

Definition at line 141 of file dtm0_log_ut.c.

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

◆ ut_dl_init_buf()

static int ut_dl_init_buf ( struct m0_buf buf,
int  rand 
)
static

Definition at line 114 of file dtm0_log_ut.c.

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

◆ ut_dl_verify_buf()

static bool ut_dl_verify_buf ( struct m0_buf buf,
int  rand 
)
static

Definition at line 129 of file dtm0_log_ut.c.

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

◆ ut_dl_verify_log_rec()

static bool ut_dl_verify_log_rec ( struct m0_dtm0_log_rec rec,
int  rand 
)
static

Definition at line 162 of file dtm0_log_ut.c.

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

Variable Documentation

◆ dtm0_log_ut

struct m0_ut_suite dtm0_log_ut
Initial value:
= {
.ts_name = "dtm0-log-ut",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "dtm0-log-list", test_volatile_dtm0_log },
{ "dtm0-log-persistent", m0_be_ut_dtm0_log_test },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void m0_be_ut_dtm0_log_test(void)
Definition: dtm0_log_ut.c:568
void test_volatile_dtm0_log(void)
Definition: dtm0_log_ut.c:169

Definition at line 608 of file dtm0_log_ut.c.

◆ seg

struct m0_be_seg* seg
static

Definition at line 291 of file dtm0_log_ut.c.

◆ ut_be

struct m0_be_ut_backend* ut_be
static

Definition at line 289 of file dtm0_log_ut.c.

◆ ut_seg

struct m0_be_ut_seg* ut_seg
static

Definition at line 290 of file dtm0_log_ut.c.