- Real-time ETA display is only printed if output is to a terminal.
- Accordingly, add --eta=always|never|auto option.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
--cmdhelp=cmd Print command help, "all" for all of them
--showcmd Turn a job file into command line options
--readonly Turn on safety read-only checks
+ --eta=when When ETA estimate should be printed
+ May be "always", "never" or "auto"
+
Any parameters following the options will be assumed to be job files,
unless they match a job file parameter. You can add as many as you want,
static struct timeval rate_prev_time, disp_prev_time;
static unsigned int rate[2];
- if (temp_stall_ts || terse_output)
+ if (temp_stall_ts || terse_output || eta_print == FIO_ETA_NEVER)
+ return;
+
+ if (!isatty(STDOUT_FILENO) && (eta_print != FIO_ETA_ALWAYS))
return;
if (!rate_io_bytes[0] && !rate_io_bytes[1])
FIO_FSERVICE_RR = 2,
};
+/*
+ * when should interactive ETA output be generated
+ */
+enum {
+ FIO_ETA_AUTO,
+ FIO_ETA_ALWAYS,
+ FIO_ETA_NEVER,
+};
+
/*
* 30 second per-io_u timeout, with 5 second intervals to avoid resetting
* the timer on each queue operation.
extern unsigned long long mlock_size;
extern unsigned long page_mask, page_size;
extern int read_only;
+extern int eta_print;
extern struct thread_data *threads;
int exitall_on_terminate = 0;
int terse_output = 0;
+int eta_print;
unsigned long long mlock_size = 0;
FILE *f_out = NULL;
FILE *f_err = NULL;
.has_arg = no_argument,
.val = 'r',
},
+ {
+ .name = "eta",
+ .has_arg = required_argument,
+ .val = 'e',
+ },
{
.name = NULL,
},
printf("\t--help\t\tPrint this page\n");
printf("\t--cmdhelp=cmd\tPrint command help, \"all\" for all of them\n");
printf("\t--showcmd\tTurn a job file into command line options\n");
+ printf("\t--eta=when\tWhen ETA estimate should be printed\n");
+ printf("\t \tMay be \"always\", \"never\" or \"auto\"\n");
}
static int parse_cmd_line(int argc, char *argv[])
case 'v':
printf("%s\n", fio_version_string);
exit(0);
+ case 'e':
+ if (!strcmp("always", optarg))
+ eta_print = FIO_ETA_ALWAYS;
+ else if (!strcmp("never", optarg))
+ eta_print = FIO_ETA_NEVER;
+ break;
case FIO_GETOPT_JOB: {
const char *opt = long_options[lidx].name;
char *val = optarg;