static int __handle_option(struct fio_option *o, const char *ptr, void *data,
int first, int more, int curr)
{
- int il, *ilp;
+ int il=0, *ilp;
fio_fp64_t *flp;
long long ull, *ullp;
long ul1, ul2;
** Initialize precision to 0 and zero out list
** in case specified list is shorter than default
*/
- ul2 = 0;
- ilp = td_var(data, o->off2);
- *ilp = ul2;
+ if (o->off2) {
+ ul2 = 0;
+ ilp = td_var(data, o->off2);
+ *ilp = ul2;
+ }
flp = td_var(data, o->off1);
for(i = 0; i < o->maxlen; i++)
while (*++cp2 != '\0' && *cp2 >= '0' && *cp2 <= '9')
len++;
- ilp = td_var(data, o->off2);
- if (len > *ilp)
- *ilp = len;
+ if (o->off2) {
+ ilp = td_var(data, o->off2);
+ if (len > *ilp)
+ *ilp = len;
+ }
}
break;
}
case FIO_OPT_DEPRECATED:
log_info("Option %s is deprecated\n", o->name);
+ ret = 1;
break;
default:
log_err("Bad option type %u\n", o->type);
}
int parse_option(char *opt, const char *input,
- struct fio_option *options, struct fio_option **o, void *data)
+ struct fio_option *options, struct fio_option **o, void *data,
+ int dump_cmdline)
{
char *post;
return 1;
}
- if (!handle_option(*o, post, data))
- return 0;
+ if (handle_option(*o, post, data)) {
+ log_err("fio: failed parsing %s\n", input);
+ return 1;
+ }
- log_err("fio: failed parsing %s\n", input);
- return 1;
+ if (dump_cmdline) {
+ const char *delim;
+
+ if (!strcmp("description", (*o)->name))
+ delim = "\"";
+ else
+ delim = "";
+
+ log_info("--%s%s", (*o)->name, post ? "" : " ");
+ if (post)
+ log_info("=%s%s%s ", delim, post, delim);
+ }
+
+ return 0;
}
/*
continue;
if (!exec_profile && o->prof_name)
continue;
+ if (exec_profile && !(o->prof_name && !strcmp(exec_profile, o->prof_name)))
+ continue;
if (name) {
if (!strcmp(name, o->name) ||