Add support for reading iolog from stdin and update HOWTO and man page.
Fixes: https://github.com/axboe/fio/issues/997
Signed-off-by: Shundong Zhou <donny372@gmail.com>
character. See the :option:`filename` option for information on how to
escape ':' characters within the file names. These files will
be sequentially assigned to job clones created by :option:`numjobs`.
character. See the :option:`filename` option for information on how to
escape ':' characters within the file names. These files will
be sequentially assigned to job clones created by :option:`numjobs`.
+ '-' is a reserved name, meaning read from stdin, notably if
+ :option:`filename` is set to '-' which means stdin as well, then
+ this flag can't be set to '-'.
.. option:: read_iolog_chunked=bool
.. option:: read_iolog_chunked=bool
You can specify a number of files by separating the names with a ':' character.
See the \fBfilename\fR option for information on how to escape ':'
characters within the file names. These files will be sequentially assigned to
You can specify a number of files by separating the names with a ':' character.
See the \fBfilename\fR option for information on how to escape ':'
characters within the file names. These files will be sequentially assigned to
-job clones created by \fBnumjobs\fR.
+job clones created by \fBnumjobs\fR. '-' is a reserved name, meaning read from
+stdin, notably if \fBfilename\fR is set to '-' which means stdin as well,
+then this flag can't be set to '-'.
.TP
.BI read_iolog_chunked \fR=\fPbool
Determines how iolog is read. If false (default) entire \fBread_iolog\fR will
.TP
.BI read_iolog_chunked \fR=\fPbool
Determines how iolog is read. If false (default) entire \fBread_iolog\fR will
}
ret = fio_options_parse(td, opts, num_opts);
}
ret = fio_options_parse(td, opts, num_opts);
+
+ if (!ret) {
+ if (!strcmp(file, "-") && td->o.read_iolog_file != NULL) {
+ char *fname = get_name_by_idx(td->o.read_iolog_file,
+ td->subjob_number);
+ if (!strcmp(fname, "-")) {
+ log_err("fio: we can't read both iolog "
+ "and job file from stdin.\n");
+ ret = 1;
+ }
+ }
+ }
if (!ret) {
if (dump_cmdline)
dump_opt_list(td);
if (!ret) {
if (dump_cmdline)
dump_opt_list(td);
fd = open_socket(fname);
if (fd >= 0)
f = fdopen(fd, "r");
fd = open_socket(fname);
if (fd >= 0)
f = fdopen(fd, "r");
+ } else if (!strcmp(fname, "-")) {
+ f = stdin;
} else
f = fopen(fname, "r");
} else
f = fopen(fname, "r");