Signed-off-by: Jens Axboe <axboe@fb.com>
optind = 1;
while ((c = getopt_long_only(argc, argv, ostr, l_opts, &lidx)) != -1) {
optind = 1;
while ((c = getopt_long_only(argc, argv, ostr, l_opts, &lidx)) != -1) {
if ((c & FIO_CLIENT_FLAG) || client_flag_set(c)) {
parse_cmd_client(cur_client, argv[optind - 1]);
c &= ~FIO_CLIENT_FLAG;
if ((c & FIO_CLIENT_FLAG) || client_flag_set(c)) {
parse_cmd_client(cur_client, argv[optind - 1]);
c &= ~FIO_CLIENT_FLAG;
append_terse_output = 1;
break;
case 'h':
append_terse_output = 1;
break;
case 'h':
if (!cur_client) {
usage(argv[0]);
do_exit++;
}
break;
case 'c':
if (!cur_client) {
usage(argv[0]);
do_exit++;
}
break;
case 'c':
if (!cur_client) {
fio_show_option_help(optarg);
do_exit++;
}
break;
case 'i':
if (!cur_client) {
fio_show_option_help(optarg);
do_exit++;
}
break;
case 'i':
if (!cur_client) {
fio_show_ioengine_help(optarg);
do_exit++;
}
break;
case 's':
if (!cur_client) {
fio_show_ioengine_help(optarg);
do_exit++;
}
break;
case 's':
dump_cmdline = 1;
break;
case 'r':
read_only = 1;
break;
case 'v':
dump_cmdline = 1;
break;
case 'r':
read_only = 1;
break;
case 'v':
if (!cur_client) {
log_info("%s\n", fio_version_string);
do_exit++;
if (!cur_client) {
log_info("%s\n", fio_version_string);
do_exit++;
do_exit++;
break;
case 'P':
do_exit++;
break;
case 'P':
parse_only = 1;
break;
case 'x': {
parse_only = 1;
break;
case 'x': {
if (exec_profile)
free(exec_profile);
exec_profile = strdup(optarg);
if (exec_profile)
free(exec_profile);
exec_profile = strdup(optarg);
if (ret)
goto out_free;
td = NULL;
if (ret)
goto out_free;
td = NULL;
}
if (!td) {
int is_section = !strncmp(opt, "name", 4);
}
if (!td) {
int is_section = !strncmp(opt, "name", 4);
break;
ret = fio_cmd_ioengine_option_parse(td, opt, val);
break;
ret = fio_cmd_ioengine_option_parse(td, opt, val);
if (nr_clients) {
log_err("fio: can't be both client and server\n");
do_exit++;
if (nr_clients) {
log_err("fio: can't be both client and server\n");
do_exit++;
case 'I':
if ((ret = fio_idle_prof_parse_opt(optarg))) {
/* exit on error and calibration only */
case 'I':
if ((ret = fio_idle_prof_parse_opt(optarg))) {
/* exit on error and calibration only */
exit_val = 1;
}
break;
case 'C':
exit_val = 1;
}
break;
case 'C':
if (is_backend) {
log_err("fio: can't be both client and server\n");
do_exit++;
if (is_backend) {
log_err("fio: can't be both client and server\n");
do_exit++;
do_exit++;
exit_val = fio_monotonic_clocktest();
break;
case 'G':
do_exit++;
exit_val = fio_monotonic_clocktest();
break;
case 'G':
do_exit++;
exit_val = fio_crctest(optarg);
break;
do_exit++;
exit_val = fio_crctest(optarg);
break;
free(pid_file);
if (td) {
free(pid_file);
if (td) {
ret = add_job(td, td->o.name ?: "fio", 0, 0, client_type);
ret = add_job(td, td->o.name ?: "fio", 0, 0, client_type);
+ if (ret)
+ did_arg = 1;
+ }
}
while (!ret && optind < argc) {
}
while (!ret && optind < argc) {