int read_only = 0;
int status_interval = 0;
+char *trigger_file = NULL;
+long long trigger_timeout = 0;
+char *trigger_cmd = NULL;
+char *trigger_remote_cmd = NULL;
+
static int prev_group_jobs;
unsigned long fio_debug = 0;
.has_arg = required_argument,
.val = 'L',
},
+ {
+ .name = (char *) "trigger-file",
+ .has_arg = required_argument,
+ .val = 'W',
+ },
+ {
+ .name = (char *) "trigger-timeout",
+ .has_arg = required_argument,
+ .val = 'B',
+ },
+ {
+ .name = (char *) "trigger",
+ .has_arg = required_argument,
+ .val = 'H',
+ },
+ {
+ .name = (char *) "trigger-remote",
+ .has_arg = required_argument,
+ .val = 'J',
+ },
{
.name = NULL,
},
free_threads_shm();
}
+ free(trigger_file);
+ free(trigger_cmd);
+ free(trigger_remote_cmd);
+ trigger_file = trigger_cmd = trigger_remote_cmd = NULL;
+
options_free(fio_options, &def_thread);
fio_filelock_exit();
scleanup();
if (!o->max_bs[DDIR_TRIM])
o->max_bs[DDIR_TRIM] = o->bs[DDIR_TRIM];
-
o->rw_min_bs = min(o->min_bs[DDIR_READ], o->min_bs[DDIR_WRITE]);
o->rw_min_bs = min(o->min_bs[DDIR_TRIM], o->rw_min_bs);
td->flags |= TD_F_READ_IOLOG;
if (o->refill_buffers)
td->flags |= TD_F_REFILL_BUFFERS;
- if (o->scramble_buffers)
+ /*
+ * Scramble by default, but not if zero_buffer is true and has been
+ * set. But if scramble_buffers has been set, always scramble.
+ */
+ if (o->scramble_buffers && ((!o->zero_buffers &&
+ fio_option_is_set(o, zero_buffers)) ||
+ fio_option_is_set(o, scramble_buffers)))
td->flags |= TD_F_SCRAMBLE_BUFFERS;
if (o->verify != VERIFY_NONE)
td->flags |= TD_F_VER_NONE;
#ifdef CONFIG_ZLIB
printf(" --inflate-log=log\tInflate and output compressed log\n");
#endif
+ printf(" --trigger-file=file\tExecute trigger cmd when file exists\n");
+ printf(" --trigger-timeout=t\tExecute trigger af this time\n");
+ printf(" --trigger=cmd\t\tSet this command as local trigger\n");
+ printf(" --trigger-remote=cmd\tSet this command as remote trigger\n");
printf("\nFio was written by Jens Axboe <jens.axboe@oracle.com>");
printf("\n Jens Axboe <jaxboe@fusionio.com>");
printf("\n Jens Axboe <axboe@fb.com>\n");
fio_client_add_cmd_option(client, opt);
}
+static void show_closest_option(const char *name)
+{
+ int best_option, best_distance;
+ int i, distance;
+
+ while (*name == '-')
+ name++;
+
+ best_option = -1;
+ best_distance = INT_MAX;
+ i = 0;
+ while (l_opts[i].name) {
+ distance = string_distance(name, l_opts[i].name);
+ if (distance < best_distance) {
+ best_distance = distance;
+ best_option = i;
+ }
+ i++;
+ }
+
+ if (best_option != -1)
+ log_err("Did you mean %s?\n", l_opts[best_option].name);
+}
+
int parse_cmd_line(int argc, char *argv[], int client_type)
{
struct thread_data *td = NULL;
case 'E': {
long long t = 0;
- if (str_to_decimal(optarg, &t, 0, NULL, 1)) {
+ if (check_str_time(optarg, &t, 1)) {
log_err("fio: failed parsing eta time %s\n", optarg);
exit_val = 1;
do_exit++;
}
- eta_new_line = t;
+ eta_new_line = t / 1000;
break;
}
case 'd':
case 'L': {
long long val;
- if (check_str_time(optarg, &val, 0)) {
+ if (check_str_time(optarg, &val, 1)) {
log_err("fio: failed parsing time %s\n", optarg);
do_exit++;
exit_val = 1;
break;
}
- status_interval = val * 1000;
+ status_interval = val / 1000;
break;
}
+ case 'W':
+ trigger_file = strdup(optarg);
+ break;
+ case 'H':
+ trigger_cmd = strdup(optarg);
+ break;
+ case 'J':
+ trigger_remote_cmd = strdup(optarg);
+ break;
+ case 'B':
+ if (check_str_time(optarg, &trigger_timeout, 1)) {
+ log_err("fio: failed parsing time %s\n", optarg);
+ do_exit++;
+ exit_val = 1;
+ }
+ trigger_timeout /= 1000000;
+ break;
case '?':
log_err("%s: unrecognized option '%s'\n", argv[0],
argv[optind - 1]);
+ show_closest_option(argv[optind - 1]);
default:
do_exit++;
exit_val = 1;