diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-08-07 18:21:52 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-08-07 18:21:52 -0600 |
commit | f0ed01ed095cf1ca7c1945a5a0267e8f73b7b4a9 (patch) | |
tree | fef397960e2cd37a003b6f4b67e10d1423c05022 | |
parent | 87622bf5295880682bfad5ba14116cf5facbaf2c (diff) | |
parent | d19c04d12b6996c4b9f6f4e27dd5a7570eea1ddc (diff) | |
download | fio-f0ed01ed095cf1ca7c1945a5a0267e8f73b7b4a9.tar.gz fio-f0ed01ed095cf1ca7c1945a5a0267e8f73b7b4a9.tar.bz2 |
Merge branch 'master' of https://github.com/donny372/fio into master
* 'master' of https://github.com/donny372/fio:
Add support for reading iolog from stdin.
-rw-r--r-- | HOWTO | 3 | ||||
-rw-r--r-- | fio.1 | 4 | ||||
-rw-r--r-- | init.c | 12 | ||||
-rw-r--r-- | iolog.c | 2 |
4 files changed, 20 insertions, 1 deletions
@@ -2625,6 +2625,9 @@ I/O replay 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 @@ -2336,7 +2336,9 @@ replay, the file needs to be turned into a blkparse binary data file first 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 @@ -2068,6 +2068,18 @@ static int __parse_jobs_ini(struct thread_data *td, } 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); @@ -620,6 +620,8 @@ static bool init_iolog_read(struct thread_data *td) fd = open_socket(fname); if (fd >= 0) f = fdopen(fd, "r"); + } else if (!strcmp(fname, "-")) { + f = stdin; } else f = fopen(fname, "r"); |