Motr  M0
Crate
Collaboration diagram for Crate:

Modules

 Workload module for client DIX
 
 Workload module for client.
 

Data Structures

struct  csum_alg
 
struct  crate_conf
 
struct  m0_workload_index
 
struct  m0_workload_task
 
struct  cwi_global
 
struct  m0_workload_io
 
struct  cti_global
 
struct  m0_task_io
 

Enumerations

enum  m0_operation_type { INDEX, IO }
 
enum  cr_opcode {
  CRATE_OP_PUT, CRATE_OP_GET, CRATE_OP_NEXT, CRATE_OP_DEL,
  CRATE_OP_TYPES, CRATE_OP_NR = CRATE_OP_TYPES, CRATE_OP_START = CRATE_OP_PUT, CRATE_OP_INVALID = CRATE_OP_TYPES
}
 
enum  m0_operations {
  CR_CREATE, CR_OPEN, CR_WRITE, CR_READ,
  CR_DELETE, CR_POPULATE, CR_CLEANUP, CR_READ_ONLY,
  CR_OPS_NR
}
 
enum  m0_operation_status { CR_OP_NEW, CR_OP_EXECUTING, CR_OP_COMPLETE }
 
enum  thread_operation { CR_WRITE_TO_SAME = 0, CR_WRITE_TO_DIFF }
 

Functions

static int hpcs_init (struct workload *w)
 
static int hpcs_fini (struct workload *w)
 
static void hpcs_run (struct workload *w, struct workload_task *task)
 
static void hpcs_op_get (struct workload *w, struct workload_op *op)
 
static void hpcs_op_run (struct workload *w, struct workload_task *task, const struct workload_op *op)
 
static int hpcs_parse (struct workload *w, char ch, const char *optarg)
 
static void hpcs_check (struct workload *w)
 
static int csum_init (struct workload *w)
 
static int csum_fini (struct workload *w)
 
static void csum_run (struct workload *w, struct workload_task *task)
 
static void csum_op_get (struct workload *w, struct workload_op *op)
 
static void csum_op_run (struct workload *w, struct workload_task *task, const struct workload_op *op)
 
static int csum_parse (struct workload *w, char ch, const char *optarg)
 
static void csum_check (struct workload *w)
 
static void fletcher_2_native (void *buf, uint64_t size)
 
static void fletcher_4_native (void *buf, uint64_t size)
 
static void csum_touch (void *buf, uint64_t size)
 
static void csum_none (void *buf, uint64_t size)
 
static const struct workload_type_opswop (struct workload *w)
 
static unsigned long long getrnd (unsigned long long a, unsigned long long b)
 
static long long min (long long a, long long b)
 
static long long max (long long a, long long b)
 
void timeval_norm (struct timeval *t)
 
int workload_init (struct workload *w, enum cr_workload_type wtype)
 
static void workload_fini (struct workload *w)
 
static int workload_op_get (struct workload *w, struct workload_op *op)
 
static bcnt_t w_size (const struct workload *w)
 
static enum csum_op_type rw_get (const struct workload *w)
 
static void * worker_thread (void *datum)
 
void workload_start (struct workload *w, struct workload_task *task)
 
void workload_join (struct workload *w, struct workload_task *task)
 
static void workload_run (struct workload *w)
 
static struct cr_hpcs * w2hpcs (struct workload *w)
 
static struct cr_csum * w2csum (struct workload *w)
 
static uint32_t csum_shuffle32 (uint32_t in)
 
static uint64_t csum_shuffle64 (uint64_t in)
 
static void csum_compute (struct workload *w, void *buf, size_t count)
 
static void csum_csum (struct workload *w, struct cr_csum *s, char *buf, bcnt_t count)
 
static void csum_io (struct workload *w, struct cr_csum *s, const struct workload_op *op, bcnt_t offset, bcnt_t count, int opcode, const char *opname)
 
static int csum_dev_open (struct workload *w, const char *dev_name)
 
static void usage (void)
 
void print_workload_detail (struct workload *w, int idx)
 
int main (int argc, char **argv)
 
int parse_crate (int argc, char **argv, struct workload *w)
 
void run (struct workload *w, struct workload_task *task)
 
void m0_op_run (struct workload *w, struct workload_task *task, const struct workload_op *op)
 
void run_index (struct workload *w, struct workload_task *tasks)
 
void m0_op_run_index (struct workload *w, struct workload_task *task, const struct workload_op *op)
 

Variables

struct crate_confconf
 
const char cr_default_fpattern [] = "./dir%i/f%i.%i"
 
const bcnt_t cr_default_avg = 64 * 1024
 
const bcnt_t cr_default_max = 1024 * 1024
 
const int cr_default_ops = 1000
 
const bcnt_t cr_default_block = 0
 
const int cr_default_nr_dir = 1
 
const int cr_default_nr_thread = 1
 
const short cr_default_read_frac = 50
 
const bcnt_t cr_default_blocksize = 16 * 1024
 
const bcnt_t cr_default_csum_size = 16
 
const bcnt_t cr_default_key_size = sizeof(struct m0_fid)
 
const bcnt_t cr_default_max_ksize = 1 << 10
 
const bcnt_t cr_default_max_vsize = 1 << 20
 
const char * cr_workload_name [CWT_NR]
 
static const struct workload_type_ops w_ops [CWT_NR]
 
static const struct csum_alg csums []
 
struct {
   int   opcode
 
   const char *   opname
 
optable [COT_NR]
 

Detailed Description

Utility for executing simple performance tests.

Crate is a performance benchmark tool for Motr via Client/m0t1fs.

Enumeration Type Documentation

◆ cr_opcode

enum cr_opcode
Enumerator
CRATE_OP_PUT 
CRATE_OP_GET 
CRATE_OP_NEXT 
CRATE_OP_DEL 
CRATE_OP_TYPES 
CRATE_OP_NR 
CRATE_OP_START 
CRATE_OP_INVALID 

Definition at line 65 of file crate_client.h.

◆ m0_operation_status

Enumerator
CR_OP_NEW 
CR_OP_EXECUTING 
CR_OP_COMPLETE 

Definition at line 139 of file crate_client.h.

◆ m0_operation_type

Enumerator
INDEX 
IO 

Definition at line 60 of file crate_client.h.

◆ m0_operations

Enumerator
CR_CREATE 
CR_OPEN 
CR_WRITE 
CR_READ 
CR_DELETE 
CR_POPULATE 
CR_CLEANUP 
CR_READ_ONLY 
CR_OPS_NR 

Definition at line 127 of file crate_client.h.

◆ thread_operation

Enumerator
CR_WRITE_TO_SAME 
CR_WRITE_TO_DIFF 

Definition at line 145 of file crate_client.h.

Function Documentation

◆ csum_check()

static void csum_check ( struct workload w)
static

Definition at line 1151 of file crate.c.

◆ csum_compute()

static void csum_compute ( struct workload w,
void *  buf,
size_t  count 
)
static

Definition at line 834 of file crate.c.

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

◆ csum_csum()

static void csum_csum ( struct workload w,
struct cr_csum *  s,
char *  buf,
bcnt_t  count 
)
static

Definition at line 885 of file crate.c.

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

◆ csum_dev_open()

static int csum_dev_open ( struct workload w,
const char *  dev_name 
)
static

Definition at line 995 of file crate.c.

Here is the caller graph for this function:

◆ csum_fini()

static int csum_fini ( struct workload w)
static

Definition at line 720 of file crate.c.

Here is the call graph for this function:

◆ csum_init()

static int csum_init ( struct workload w)
static

Definition at line 705 of file crate.c.

Here is the call graph for this function:

◆ csum_io()

static void csum_io ( struct workload w,
struct cr_csum *  s,
const struct workload_op op,
bcnt_t  offset,
bcnt_t  count,
int  opcode,
const char *  opname 
)
static

Definition at line 899 of file crate.c.

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

◆ csum_none()

static void csum_none ( void *  buf,
uint64_t  size 
)
static

Definition at line 764 of file crate.c.

◆ csum_op_get()

static void csum_op_get ( struct workload w,
struct workload_op op 
)
static

Definition at line 738 of file crate.c.

Here is the call graph for this function:

◆ csum_op_run()

static void csum_op_run ( struct workload w,
struct workload_task task,
const struct workload_op op 
)
static

Definition at line 986 of file crate.c.

Here is the call graph for this function:

◆ csum_parse()

static int csum_parse ( struct workload w,
char  ch,
const char *  optarg 
)
static

Definition at line 1107 of file crate.c.

Here is the call graph for this function:

◆ csum_run()

static void csum_run ( struct workload w,
struct workload_task task 
)
static

Definition at line 1009 of file crate.c.

Here is the call graph for this function:

◆ csum_shuffle32()

static uint32_t csum_shuffle32 ( uint32_t  in)
inlinestatic

Definition at line 812 of file crate.c.

Here is the caller graph for this function:

◆ csum_shuffle64()

static uint64_t csum_shuffle64 ( uint64_t  in)
inlinestatic

Definition at line 821 of file crate.c.

Here is the caller graph for this function:

◆ csum_touch()

static void csum_touch ( void *  buf,
uint64_t  size 
)
static

Definition at line 768 of file crate.c.

◆ fletcher_2_native()

static void fletcher_2_native ( void *  buf,
uint64_t  size 
)
static

Definition at line 783 of file crate.c.

◆ fletcher_4_native()

static void fletcher_4_native ( void *  buf,
uint64_t  size 
)
static

Definition at line 797 of file crate.c.

◆ getrnd()

static unsigned long long getrnd ( unsigned long long  a,
unsigned long long  b 
)
static

Definition at line 177 of file crate.c.

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

◆ hpcs_check()

static void hpcs_check ( struct workload w)
static

Definition at line 688 of file crate.c.

◆ hpcs_fini()

static int hpcs_fini ( struct workload w)
static

Definition at line 485 of file crate.c.

◆ hpcs_init()

static int hpcs_init ( struct workload w)
static

Definition at line 480 of file crate.c.

◆ hpcs_op_get()

static void hpcs_op_get ( struct workload w,
struct workload_op op 
)
static

Definition at line 490 of file crate.c.

Here is the call graph for this function:

◆ hpcs_op_run()

static void hpcs_op_run ( struct workload w,
struct workload_task task,
const struct workload_op op 
)
static

Definition at line 532 of file crate.c.

Here is the call graph for this function:

◆ hpcs_parse()

static int hpcs_parse ( struct workload w,
char  ch,
const char *  optarg 
)
static

Definition at line 673 of file crate.c.

Here is the call graph for this function:

◆ hpcs_run()

static void hpcs_run ( struct workload w,
struct workload_task task 
)
static

Definition at line 613 of file crate.c.

Here is the call graph for this function:

◆ m0_op_run()

void m0_op_run ( struct workload w,
struct workload_task task,
const struct workload_op op 
)

Task is not prepared.

Definition at line 1093 of file crate_io.c.

Here is the call graph for this function:

◆ m0_op_run_index()

void m0_op_run_index ( struct workload w,
struct workload_task task,
const struct workload_op op 
)

Definition at line 1536 of file crate_index.c.

Here is the call graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1291 of file crate.c.

Here is the call graph for this function:

◆ max()

static long long max ( long long  a,
long long  b 
)
static

Definition at line 196 of file crate.c.

Here is the caller graph for this function:

◆ min()

static long long min ( long long  a,
long long  b 
)
static

Definition at line 191 of file crate.c.

Here is the caller graph for this function:

◆ parse_crate()

int parse_crate ( int  argc,
char **  argv,
struct workload w 
)

◆ print_workload_detail()

void print_workload_detail ( struct workload w,
int  idx 
)

Definition at line 1280 of file crate.c.

Here is the call graph for this function:

◆ run()

void run ( struct workload w,
struct workload_task task 
)

Definition at line 1009 of file crate_io.c.

Here is the call graph for this function:

◆ run_index()

void run_index ( struct workload w,
struct workload_task tasks 
)

Definition at line 1530 of file crate_index.c.

Here is the call graph for this function:

◆ rw_get()

static enum csum_op_type rw_get ( const struct workload w)
static

Definition at line 314 of file crate.c.

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

◆ timeval_norm()

void timeval_norm ( struct timeval *  t)

Normalize struct timeval, so that microseconds field (tv_usec) is less than one million.

Definition at line 204 of file crate.c.

◆ usage()

static void usage ( void  )
static

Definition at line 1155 of file crate.c.

Here is the caller graph for this function:

◆ w2csum()

static struct cr_csum* w2csum ( struct workload w)
inlinestatic

Definition at line 700 of file crate.c.

Here is the caller graph for this function:

◆ w2hpcs()

static struct cr_hpcs* w2hpcs ( struct workload w)
inlinestatic

Definition at line 475 of file crate.c.

◆ w_size()

static bcnt_t w_size ( const struct workload w)
static

Definition at line 295 of file crate.c.

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

◆ wop()

static const struct workload_type_ops* wop ( struct workload w)
static

Definition at line 170 of file crate.c.

Here is the caller graph for this function:

◆ worker_thread()

static void* worker_thread ( void *  datum)
static

Definition at line 319 of file crate.c.

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

◆ workload_fini()

static void workload_fini ( struct workload w)
static

Definition at line 243 of file crate.c.

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

◆ workload_init()

int workload_init ( struct workload w,
enum cr_workload_type  wtype 
)

Definition at line 216 of file crate.c.

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

◆ workload_join()

void workload_join ( struct workload w,
struct workload_task task 
)

Definition at line 363 of file crate.c.

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

◆ workload_op_get()

static int workload_op_get ( struct workload w,
struct workload_op op 
)
static

Definition at line 253 of file crate.c.

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

◆ workload_run()

static void workload_run ( struct workload w)
static

Definition at line 378 of file crate.c.

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

◆ workload_start()

void workload_start ( struct workload w,
struct workload_task task 
)

Definition at line 340 of file crate.c.

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

Variable Documentation

◆ conf

struct crate_conf* conf

Definition at line 38 of file crate_client_utils.c.

◆ cr_default_avg

const bcnt_t cr_default_avg = 64 * 1024

Definition at line 59 of file crate.c.

◆ cr_default_block

const bcnt_t cr_default_block = 0

Definition at line 62 of file crate.c.

◆ cr_default_blocksize

const bcnt_t cr_default_blocksize = 16 * 1024

Definition at line 66 of file crate.c.

◆ cr_default_csum_size

const bcnt_t cr_default_csum_size = 16

Definition at line 67 of file crate.c.

◆ cr_default_fpattern

const char cr_default_fpattern[] = "./dir%i/f%i.%i"

Definition at line 58 of file crate.c.

◆ cr_default_key_size

const bcnt_t cr_default_key_size = sizeof(struct m0_fid)

Definition at line 68 of file crate.c.

◆ cr_default_max

const bcnt_t cr_default_max = 1024 * 1024

Definition at line 60 of file crate.c.

◆ cr_default_max_ksize

const bcnt_t cr_default_max_ksize = 1 << 10

Definition at line 69 of file crate.c.

◆ cr_default_max_vsize

const bcnt_t cr_default_max_vsize = 1 << 20

Definition at line 70 of file crate.c.

◆ cr_default_nr_dir

const int cr_default_nr_dir = 1

Definition at line 63 of file crate.c.

◆ cr_default_nr_thread

const int cr_default_nr_thread = 1

Definition at line 64 of file crate.c.

◆ cr_default_ops

const int cr_default_ops = 1000

Definition at line 61 of file crate.c.

◆ cr_default_read_frac

const short cr_default_read_frac = 50

Definition at line 65 of file crate.c.

◆ cr_workload_name

const char* cr_workload_name[CWT_NR]
Initial value:
= {
[CWT_HPCS] = "hpcs",
[CWT_CSUM] = "csum",
[CWT_IO] = "io",
[CWT_INDEX] = "index",
}

Definition at line 73 of file crate.c.

◆ csums

const struct csum_alg csums[]
static
Initial value:
= {
{
.ca_label = "fletcher2",
.ca_func = fletcher_2_native
},
{
.ca_label = "fletcher4",
.ca_func = fletcher_4_native
},
{
.ca_label = "touch",
.ca_func = csum_touch
},
{
.ca_label = "sha256",
.ca_func = NULL
},
{
.ca_label = "none",
.ca_func = csum_none
}
}
static void fletcher_2_native(void *buf, uint64_t size)
Definition: crate.c:783
#define NULL
Definition: misc.h:38
static void csum_touch(void *buf, uint64_t size)
Definition: crate.c:768
static void fletcher_4_native(void *buf, uint64_t size)
Definition: crate.c:797
static void csum_none(void *buf, uint64_t size)
Definition: crate.c:764

◆ opcode

int opcode

Definition at line 301 of file crate.c.

◆ opname

const char* opname

Definition at line 302 of file crate.c.

◆ optable

const { ... } optable[COT_NR]
Initial value:
= {
[COT_READ] = {
.opcode = LIO_READ,
.opname = "read"
},
[COT_WRITE] = {
.opcode = LIO_WRITE,
.opname = "write"
},
}

◆ w_ops

const struct workload_type_ops w_ops[CWT_NR]
static

Definition at line 98 of file crate.c.