122 {
"WORKLOAD_SEED",
SEED},
162 #define NKEYS (sizeof(lookuptable)/sizeof(struct key_lookup_table)) 181 const char *result =
NULL;
202 fprintf(stderr,
"\n");
224 if ((
val == LONG_MAX ||
val == LONG_MIN) && errno == ERANGE) {
228 if (endptr ==
value) {
235 #define SIZEOF_CWIDX sizeof(struct m0_workload_index) 236 #define SIZEOF_CWIO sizeof(struct m0_workload_io) 238 #define workload_index(t) (t->u.cw_index) 239 #define workload_io(t) (t->u.cw_io) 246 int value_len = strlen(
value);
255 "more than one config sections\n");
271 "or is not going first in the workload section\n");
295 conf->tm_recv_queue_min_len = atoi(
value);
362 if (strcmp(
value,
"tstamp"))
366 if (!strcmp(
value,
"tstamp"))
413 if (!strcmp(
value,
"default"))
421 if (!strcmp(
value,
"unlimited"))
430 if (!strcmp(
value,
"unlimited"))
437 if (!strcmp(
value,
"unlimited"))
447 if (!strcmp(
value,
"random"))
455 if (!strcmp(
value,
"ordered"))
457 else if (!strcmp(
value,
"random"))
465 if (strcmp(
value,
"random") == 0)
473 if (strcmp(
value,
"random") == 0)
477 if (strcmp(
key,
"RECORD_SIZE") == 0) {
478 cr_log(
CLL_WARN,
"RECORD_SIZE is being deprecated, use KEY_SIZE and VALUE_SIZE.\n");
492 if (strcmp(
key,
"MAX_RSIZE") == 0) {
493 cr_log(
CLL_WARN,
"MAX_RSIZE is being deprecated, use MAX_KEY_SIZE and MAX_VALUE_SIZE.\n");
507 if (!strcmp(
value,
"all"))
569 if (
conf->layout_id <= 0) {
614 if (!yaml_parser_initialize(&
parser)) {
619 fh = fopen(config_file,
"r");
622 yaml_parser_delete(&
parser);
626 yaml_parser_set_input_file(&
parser,
fh);
631 switch (
token.type) {
635 case YAML_VALUE_TOKEN:
638 case YAML_SCALAR_TOKEN:
639 scalar_value = (
char *)
token.data.scalar.value;
641 strcpy(
key, scalar_value);
656 yaml_token_delete(&
token);
657 yaml_parser_delete(&
parser);
662 if (
token.type != YAML_STREAM_END_TOKEN)
663 yaml_token_delete(&
token);
665 }
while (
token.type != YAML_STREAM_END_TOKEN);
667 yaml_token_delete(&
token);
668 yaml_parser_delete(&
parser);
const m0_time_t M0_TIME_NEVER
static uint64_t tag(uint8_t code, uint64_t id)
static int parse_int_with_units(const char *value, enum config_key_val tag)
int const char const void * value
enum m0_md_lustre_logrec_type __attribute__
int opcode_prcnt[CRATE_OP_TYPES]
m0_time_t m0_time(uint64_t secs, long ns)
int copy_value(struct workload *load, int max_workload, int *index, char *key, char *value)
enum config_key_val index
unsigned long long getnum(const char *str, const char *msg)
const struct m0_uint128 M0_ID_APP
enum config_key_val get_index_from_key(char *key)
uint32_t cwi_bcount_per_op
const char conf_section_name[]
void parser_emit_error(const char *fmt,...) __attribute__((no_exit)) __attribute__((format(printf
char * fmt(const char *format,...) __attribute__((format(printf
void * m0_alloc(size_t size)
static void token(struct ff2c_context *ctx, struct ff2c_term *term, struct ff2c_token *tok)
struct m0_fid cwi_pool_id
#define workload_index(t)
M0_INTERNAL int m0_fid_sscanf(const char *s, struct m0_fid *fid)
int parse_yaml_file(struct workload *load, int max_workload, int *index, char *config_file)
struct workload_type_ops index_ops
struct m0_uint128 cwi_start_obj_id
static void workload_init(struct sim *s, int argc, char **argv)
static int parse_int(const char *value, enum config_key_val tag)
void cr_log(enum cr_log_level lev, const char *fmt,...)
enum cr_workload_type cw_type
struct key_lookup_table lookuptable[]
struct workload_type_ops ops
const char * get_key_from_index(const enum config_key_val key)
m0_time_t cwi_execution_time