Motr  M0
crate.c File Reference
#include <unistd.h>
#include <stdlib.h>
#include <err.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
#include <inttypes.h>
#include <aio.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <pthread.h>
#include <errno.h>
#include "lib/memory.h"
#include "lib/types.h"
#include "lib/trace.h"
#include "module/instance.h"
#include "motr/m0crate/logger.h"
#include "motr/m0crate/workload.h"
#include "motr/m0crate/parser.h"
#include "motr/m0crate/crate_client.h"
#include "motr/m0crate/crate_utils.h"
Include dependency graph for crate.c:

Go to the source code of this file.

Data Structures

struct  csum_alg
 

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)
 

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]
 

Variable Documentation

◆ opcode

int opcode

Definition at line 301 of file crate.c.

◆ opname

const char* opname

Definition at line 302 of file crate.c.