124 {
"WORKLOAD_SEED",
SEED},
165 #define NKEYS (sizeof(lookuptable)/sizeof(struct key_lookup_table)) 184 const char *result =
NULL;
205 fprintf(stderr,
"\n");
227 if ((
val == LONG_MAX ||
val == LONG_MIN) && errno == ERANGE) {
231 if (endptr ==
value) {
238 #define SIZEOF_CWIDX sizeof(struct m0_workload_index) 239 #define SIZEOF_CWIO sizeof(struct m0_workload_io) 241 #define workload_index(t) (t->u.cw_index) 242 #define workload_io(t) (t->u.cw_io) 249 int value_len = strlen(
value);
258 "more than one config sections\n");
274 "or is not going first in the workload section\n");
298 conf->tm_recv_queue_min_len = atoi(
value);
365 if (strcmp(
value,
"tstamp"))
369 if (!strcmp(
value,
"tstamp"))
416 if (!strcmp(
value,
"default"))
424 if (!strcmp(
value,
"unlimited"))
433 if (!strcmp(
value,
"unlimited"))
440 if (!strcmp(
value,
"unlimited"))
450 if (!strcmp(
value,
"random"))
458 if (!strcmp(
value,
"ordered"))
460 else if (!strcmp(
value,
"random"))
468 if (strcmp(
value,
"random") == 0)
476 if (strcmp(
value,
"random") == 0)
480 if (strcmp(
key,
"RECORD_SIZE") == 0) {
481 cr_log(
CLL_WARN,
"RECORD_SIZE is being deprecated, use KEY_SIZE and VALUE_SIZE.\n");
495 if (strcmp(
key,
"MAX_RSIZE") == 0) {
496 cr_log(
CLL_WARN,
"MAX_RSIZE is being deprecated, use MAX_KEY_SIZE and MAX_VALUE_SIZE.\n");
510 if (!strcmp(
value,
"all"))
572 if (
conf->layout_id <= 0) {
620 if (!yaml_parser_initialize(&
parser)) {
625 fh = fopen(config_file,
"r");
628 yaml_parser_delete(&
parser);
632 yaml_parser_set_input_file(&
parser,
fh);
637 switch (
token.type) {
641 case YAML_VALUE_TOKEN:
644 case YAML_SCALAR_TOKEN:
645 scalar_value = (
char *)
token.data.scalar.value;
647 strcpy(
key, scalar_value);
662 yaml_token_delete(&
token);
663 yaml_parser_delete(&
parser);
668 if (
token.type != YAML_STREAM_END_TOKEN)
669 yaml_token_delete(&
token);
671 }
while (
token.type != YAML_STREAM_END_TOKEN);
673 yaml_token_delete(&
token);
674 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