Coda Distributed File System
Classes | Macros | Typedefs | Enumerations | Functions | Variables
rvm_basher.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <string.h>
#include <time.h>
#include <rvm/rvm.h>
#include <rvm/rvm_statistics.h>
#include <rvm/rvm_segment.h>
#include <rvm/rds.h>
#include <cthreads.h>
Include dependency graph for rvm_basher.c:

Classes

struct  list_entry_s
 
struct  block_t
 
struct  str_name_entry_t
 

Macros

#define RVM_MAJOR_VERSION   1
 
#define RVM_MINOR_VERSION   3
 
#define RVM_MUTEX   struct mutex
 
#define RVM_CONDITION   struct condition
 
#define CODA_ASSERT(ex)
 
#define CRITICAL(lock, body)
 
#define CMD_MAX   2048 /* maximum cmd line length */
 
#define STR_NAME_LEN   31 /* maximum length of string name */
 
#define FLUSH_DEFAULT   20
 
#define ABORT_DEFAULT   10
 
#define RESTORE_DEFAULT   20
 
#define TRANS_DEFAULT   10
 
#define RANGES_DEFAULT   100
 
#define CYCLES_DEFAULT   -1
 
#define OP_CNT_DEFAULT   1000
 
#define THREADS_DEFAULT   25
 
#define BLOCK_SIZE_DEFAULT   10000
 
#define MOD_SIZE_DEFAULT   10000
 
#define MOBY_MOD_SIZE_DEFAULT   1000000
 
#define PRE_ALLOC_DEFAULT   1000
 
#define SEED_DEFAULT   1
 
#define CHK_ALLOC_DEFAULT   0
 
#define CHK_RANGE_DEFAULT   0
 
#define LENGTH_MASK   ((rvm_length_t)(~(sizeof(rvm_length_t) - 1)))
 
#define ROUND_TO_LENGTH(len)
 
#define CHOP_TO_LENGTH(len)   ((rvm_length_t)((rvm_length_t)(len) & LENGTH_MASK))
 
#define ALIGNED_LEN(addr, len)
 
#define BYTE_SKEW(len)   ((rvm_length_t)(len) & ~LENGTH_MASK)
 
#define incr_cur(_i)   cmd_cur = &cmd_cur[_i]
 
#define end_line(c)   (((c) == '\0') || ((c) == '\n'))
 
#define scan_stop(c)   (end_line(c) || ((c) == '#'))
 
#define MAX_FLAGS   15 /* maximum number of flag codes */
 
#define MAX_CMDS   50 /* maximum number of commands */
 

Typedefs

typedef struct list_entry_s list_entry_t
 

Enumerations

enum  key_id_t {
  UNKNOWN = -123456789 , ALL_KEY = 1 , CLEAR_KEY , FILE_KEY ,
  PAGE_KEY , NUM_KEY , REC_KEY , TIME_KEY ,
  UNAME_KEY , HEAD_KEY , TAIL_KEY , NO_TAIL_KEY ,
  LOG_START_KEY , LOG_STATUS_KEY , MODS_KEY , MONITOR_KEY ,
  NEXT_KEY , PREV_KEY , NEXT_SUB_KEY , SUB_KEY ,
  PREV_SUB_KEY , PREV_HEAD_KEY , PREV_TAIL_KEY , EARLY_KEY ,
  REMAINING_KEY , REC_END_KEY , REC_HDR_KEY , READ_ONLY_KEY ,
  UPDATE_KEY , NO_UPDATE_KEY , REPLAY_KEY , SEG_DICT_KEY ,
  STATISTICS_KEY , NOT_A_KEY , UNKNOWN = -123456789 , ALL_KEY = 1 ,
  ABORT_KEY , BLOCK_SIZE_KEY , BRK_KEY , CHK_ALLOC_KEY ,
  CHK_SUM_KEY , CYCLES_KEY , DATA_KEY , FLUSH_KEY ,
  FLUSH_BUF_KEY , INCR_KEY , LOG_KEY , MAX_READ_KEY ,
  MOBY_KEY , MOBY_MAX_KEY , MOD_SIZE_KEY , NONE_KEY ,
  OPS_KEY , OPT_KEY , PARMS_KEY , PLUMBER_KEY ,
  PRE_ALLOC_KEY , PRE_ALLOC_TRUNC_KEY , PRIORITY_KEY , QUIT_KEY ,
  RANGES_KEY , REC_BUF_KEY , RESTORE_KEY , RUN_KEY ,
  SEED_KEY , THREADS_KEY , TIME_KEY , TRANS_KEY ,
  TRUNC_KEY , EPOCH_TRUNC_KEY , INCR_TRUNC_TIME_KEY , VM_KEY ,
  CHK_RANGE_KEY , NO_YIELD_KEY , VM_PROT_KEY , VM_MAP_PRIV
}
 

Functions

int main (int argc, char **argv)
 

Variables

rvm_region_def_tRegionDefs
 
long NRegionDefs
 
rvm_bool_t rds_testsw
 
list_entry_t alloc_list
 
RVM_MUTEX alloc_list_lock
 
int nthreads = 0
 
cthread_tthreads
 
int * last
 
rvm_bool_t Terminate = rvm_false
 
RVM_MUTEX init_lock
 
RVM_MUTEX thread_lock = MUTEX_INITIALIZER
 
RVM_CONDITION init_cv
 
RVM_CONDITION thread_exit_code
 
RVM_MUTEX chk_lock = MUTEX_INITIALIZER
 
rvm_bool_t chk_block
 
RVM_CONDITION blk_code
 
RVM_CONDITION chk_code
 
int blk_cnt
 
rvm_length_t optimizations
 
int max_cycles
 
int max_ranges
 
int max_trans
 
int max_block_size
 
int max_mod_size
 
int max_moby_size
 
int num_pre_alloc
 
int cycle
 
int op_cnt
 
int max_op_cnt
 
int chk_range_frac
 
int abort_frac
 
int restore_frac
 
int flush_frac
 
int trunc_frac
 
int epoch_trunc_frac
 
int incr_trunc_time
 
int seed
 
int chk_alloc
 
rvm_offset_t DataLen
 
char DataFileName [MAXPATHLEN+1]
 
char LogFileName [MAXPATHLEN+1]
 
char PlumberFileName [MAXPATHLEN+1]
 
FILE * PlumberFile
 
struct timeval init_time
 
rvm_length_t rec_buf_len
 
rvm_length_t flush_buf_len
 
rvm_length_t max_read_len
 
rvm_bool_t all_tests
 
rvm_bool_t time_tests
 
rvm_bool_t vm_test
 
rvm_bool_t moby_test
 
rvm_bool_t chk_sum_sw
 
rvm_bool_t no_yield_sw
 
rvm_bool_t vm_protect_sw
 
rvm_bool_t pre_alloc_trunc
 
rvm_bool_t show_brk
 
rvm_bool_t do_private_map
 
FILE * para_file
 

Macro Definition Documentation

◆ ABORT_DEFAULT

#define ABORT_DEFAULT   10

◆ ALIGNED_LEN

#define ALIGNED_LEN (   addr,
  len 
)
Value:
(ROUND_TO_LENGTH((rvm_length_t)(addr) + (rvm_length_t)(len)) - \
CHOP_TO_LENGTH(addr))
unsigned long rvm_length_t
Definition: rvm.h:140
#define ROUND_TO_LENGTH(len)
Definition: rvm_basher.c:328

◆ BLOCK_SIZE_DEFAULT

#define BLOCK_SIZE_DEFAULT   10000

◆ BYTE_SKEW

#define BYTE_SKEW (   len)    ((rvm_length_t)(len) & ~LENGTH_MASK)

◆ CHK_ALLOC_DEFAULT

#define CHK_ALLOC_DEFAULT   0

◆ CHK_RANGE_DEFAULT

#define CHK_RANGE_DEFAULT   0

◆ CHOP_TO_LENGTH

#define CHOP_TO_LENGTH (   len)    ((rvm_length_t)((rvm_length_t)(len) & LENGTH_MASK))

◆ CMD_MAX

#define CMD_MAX   2048 /* maximum cmd line length */

◆ CODA_ASSERT

#define CODA_ASSERT (   ex)
Value:
{ \
if (!(ex)) { \
fprintf(stderr, "ASSERTion failed: file \"%s\", line %d\n", \
fflush(stderr); \
abort(); \
} \
}
stderr
Definition: gensrvstats.py:48
#define __FILE__
Definition: odytypes.h:64
#define __LINE__
Definition: odytypes.h:68

◆ CRITICAL

#define CRITICAL (   lock,
  body 
)
Value:
do { \
mutex_lock(&lock); \
do { \
body \
} while (0); \
mutex_unlock(&lock); \
} while (0)

◆ CYCLES_DEFAULT

#define CYCLES_DEFAULT   -1

◆ end_line

#define end_line (   c)    (((c) == '\0') || ((c) == '\n'))

◆ FLUSH_DEFAULT

#define FLUSH_DEFAULT   20

◆ incr_cur

#define incr_cur (   _i)    cmd_cur = &cmd_cur[_i]

◆ LENGTH_MASK

#define LENGTH_MASK   ((rvm_length_t)(~(sizeof(rvm_length_t) - 1)))

◆ MAX_CMDS

#define MAX_CMDS   50 /* maximum number of commands */

◆ MAX_FLAGS

#define MAX_FLAGS   15 /* maximum number of flag codes */

◆ MOBY_MOD_SIZE_DEFAULT

#define MOBY_MOD_SIZE_DEFAULT   1000000

◆ MOD_SIZE_DEFAULT

#define MOD_SIZE_DEFAULT   10000

◆ OP_CNT_DEFAULT

#define OP_CNT_DEFAULT   1000

◆ PRE_ALLOC_DEFAULT

#define PRE_ALLOC_DEFAULT   1000

◆ RANGES_DEFAULT

#define RANGES_DEFAULT   100

◆ RESTORE_DEFAULT

#define RESTORE_DEFAULT   20

◆ ROUND_TO_LENGTH

#define ROUND_TO_LENGTH (   len)
Value:
(((rvm_length_t)((rvm_length_t)(len) + sizeof(rvm_length_t) - 1)) & \
LENGTH_MASK)

◆ RVM_CONDITION

#define RVM_CONDITION   struct condition

◆ RVM_MAJOR_VERSION

#define RVM_MAJOR_VERSION   1

◆ RVM_MINOR_VERSION

#define RVM_MINOR_VERSION   3

◆ RVM_MUTEX

#define RVM_MUTEX   struct mutex

◆ scan_stop

#define scan_stop (   c)    (end_line(c) || ((c) == '#'))

◆ SEED_DEFAULT

#define SEED_DEFAULT   1

◆ STR_NAME_LEN

#define STR_NAME_LEN   31 /* maximum length of string name */

◆ THREADS_DEFAULT

#define THREADS_DEFAULT   25

◆ TRANS_DEFAULT

#define TRANS_DEFAULT   10

Typedef Documentation

◆ list_entry_t

typedef struct list_entry_s list_entry_t

Enumeration Type Documentation

◆ key_id_t

enum key_id_t
Enumerator
UNKNOWN 
ALL_KEY 
CLEAR_KEY 
FILE_KEY 
PAGE_KEY 
NUM_KEY 
REC_KEY 
TIME_KEY 
UNAME_KEY 
HEAD_KEY 
TAIL_KEY 
NO_TAIL_KEY 
LOG_START_KEY 
LOG_STATUS_KEY 
MODS_KEY 
MONITOR_KEY 
NEXT_KEY 
PREV_KEY 
NEXT_SUB_KEY 
SUB_KEY 
PREV_SUB_KEY 
PREV_HEAD_KEY 
PREV_TAIL_KEY 
EARLY_KEY 
REMAINING_KEY 
REC_END_KEY 
REC_HDR_KEY 
READ_ONLY_KEY 
UPDATE_KEY 
NO_UPDATE_KEY 
REPLAY_KEY 
SEG_DICT_KEY 
STATISTICS_KEY 
NOT_A_KEY 
UNKNOWN 
ALL_KEY 
ABORT_KEY 
BLOCK_SIZE_KEY 
BRK_KEY 
CHK_ALLOC_KEY 
CHK_SUM_KEY 
CYCLES_KEY 
DATA_KEY 
FLUSH_KEY 
FLUSH_BUF_KEY 
INCR_KEY 
LOG_KEY 
MAX_READ_KEY 
MOBY_KEY 
MOBY_MAX_KEY 
MOD_SIZE_KEY 
NONE_KEY 
OPS_KEY 
OPT_KEY 
PARMS_KEY 
PLUMBER_KEY 
PRE_ALLOC_KEY 
PRE_ALLOC_TRUNC_KEY 
PRIORITY_KEY 
QUIT_KEY 
RANGES_KEY 
REC_BUF_KEY 
RESTORE_KEY 
RUN_KEY 
SEED_KEY 
THREADS_KEY 
TIME_KEY 
TRANS_KEY 
TRUNC_KEY 
EPOCH_TRUNC_KEY 
INCR_TRUNC_TIME_KEY 
VM_KEY 
CHK_RANGE_KEY 
NO_YIELD_KEY 
VM_PROT_KEY 
VM_MAP_PRIV 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Variable Documentation

◆ abort_frac

int abort_frac

◆ all_tests

rvm_bool_t all_tests

◆ alloc_list

list_entry_t alloc_list

◆ alloc_list_lock

RVM_MUTEX alloc_list_lock

◆ blk_cnt

int blk_cnt

◆ blk_code

RVM_CONDITION blk_code

◆ chk_alloc

int chk_alloc

◆ chk_block

rvm_bool_t chk_block

◆ chk_code

RVM_CONDITION chk_code

◆ chk_lock

◆ chk_range_frac

int chk_range_frac

◆ chk_sum_sw

rvm_bool_t chk_sum_sw

◆ cycle

int cycle

◆ DataFileName

char DataFileName[MAXPATHLEN+1]

◆ DataLen

rvm_offset_t DataLen

◆ do_private_map

rvm_bool_t do_private_map

◆ epoch_trunc_frac

int epoch_trunc_frac

◆ flush_buf_len

rvm_length_t flush_buf_len

◆ flush_frac

int flush_frac

◆ incr_trunc_time

int incr_trunc_time

◆ init_cv

RVM_CONDITION init_cv

◆ init_lock

RVM_MUTEX init_lock

◆ init_time

struct timeval init_time

◆ last

int* last

◆ LogFileName

char LogFileName[MAXPATHLEN+1]

◆ max_block_size

int max_block_size

◆ max_cycles

int max_cycles

◆ max_moby_size

int max_moby_size

◆ max_mod_size

int max_mod_size

◆ max_op_cnt

int max_op_cnt

◆ max_ranges

int max_ranges

◆ max_read_len

rvm_length_t max_read_len

◆ max_trans

int max_trans

◆ moby_test

rvm_bool_t moby_test

◆ no_yield_sw

rvm_bool_t no_yield_sw

◆ NRegionDefs

long NRegionDefs
extern

◆ nthreads

int nthreads = 0

◆ num_pre_alloc

int num_pre_alloc

◆ op_cnt

int op_cnt

◆ optimizations

rvm_length_t optimizations

◆ para_file

FILE* para_file

◆ PlumberFile

FILE* PlumberFile

◆ PlumberFileName

char PlumberFileName[MAXPATHLEN+1]

◆ pre_alloc_trunc

rvm_bool_t pre_alloc_trunc

◆ rds_testsw

rvm_bool_t rds_testsw
extern

◆ rec_buf_len

rvm_length_t rec_buf_len

◆ RegionDefs

rvm_region_def_t* RegionDefs
extern

◆ restore_frac

int restore_frac

◆ seed

int seed

◆ show_brk

rvm_bool_t show_brk

◆ Terminate

static void Terminate ( void  ) = rvm_false

◆ thread_exit_code

RVM_CONDITION thread_exit_code

◆ thread_lock

◆ threads

cthread_t* threads

◆ time_tests

rvm_bool_t time_tests

◆ trunc_frac

int trunc_frac

◆ vm_protect_sw

rvm_bool_t vm_protect_sw

◆ vm_test

rvm_bool_t vm_test