#include <sys/ipc.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <dlfcn.h>
#include "fio.h"
#ifndef FIO_NO_HAVE_SHM_H
int exitall_on_terminate = 0;
int output_format = FIO_OUTPUT_NORMAL;
int eta_print = FIO_ETA_AUTO;
+unsigned int eta_interval_msec = 1000;
int eta_new_line = 0;
FILE *f_out = NULL;
FILE *f_err = NULL;
.has_arg = required_argument,
.val = 'e' | FIO_CLIENT_FLAG,
},
+ {
+ .name = (char *) "eta-interval",
+ .has_arg = required_argument,
+ .val = 'O' | FIO_CLIENT_FLAG,
+ },
{
.name = (char *) "eta-newline",
.has_arg = required_argument,
}
if (td->io_ops) {
+ struct ioengine_ops *ops;
+ void *dlhandle;
+
/* An engine is loaded, but the requested ioengine
* may have changed.
*/
return 0;
}
+ /*
+ * Name of file and engine may be different, load ops
+ * for this name and see if they match. If they do, then
+ * the engine is unchanged.
+ */
+ dlhandle = td->io_ops_dlhandle;
+ ops = load_ioengine(td);
+ if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle) {
+ if (dlhandle)
+ dlclose(dlhandle);
+ return 0;
+ }
+
+ if (dlhandle && dlhandle != td->io_ops_dlhandle)
+ dlclose(dlhandle);
+
/* Unload the old engine. */
free_ioengine(td);
}
log_err("fio: failed parsing eta time %s\n", optarg);
exit_val = 1;
do_exit++;
+ break;
}
eta_new_line = t / 1000;
+ if (!eta_new_line) {
+ log_err("fio: eta new line time too short\n");
+ exit_val = 1;
+ do_exit++;
+ }
+ break;
+ }
+ case 'O': {
+ long long t = 0;
+
+ if (check_str_time(optarg, &t, 1)) {
+ log_err("fio: failed parsing eta interval %s\n", optarg);
+ exit_val = 1;
+ do_exit++;
+ break;
+ }
+ eta_interval_msec = t / 1000;
+ if (eta_interval_msec < DISK_UTIL_MSEC) {
+ log_err("fio: eta interval time too short (%umsec min)\n", DISK_UTIL_MSEC);
+ exit_val = 1;
+ do_exit++;
+ }
break;
}
case 'd':