iolog: don't attempt read chunking with blktrace format
authorJens Axboe <axboe@kernel.dk>
Mon, 2 Aug 2021 14:23:24 +0000 (08:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Aug 2021 14:23:24 +0000 (08:23 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fio.h
iolog.c

diff --git a/fio.h b/fio.h
index 51686fd0f84c82fcc2a21d6fc57ba38ca5af3429..6f6b211bc47228d98a37fe0c023d31426e5ab2d4 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -420,6 +420,7 @@ struct thread_data {
         */
        struct flist_head io_log_list;
        FILE *io_log_rfile;
+       unsigned int io_log_blktrace;
        unsigned int io_log_current;
        unsigned int io_log_checkmark;
        unsigned int io_log_highmark;
diff --git a/iolog.c b/iolog.c
index cf264916a9ecd83f7b3079bd186573441dba65fb..26501b4ae55517afecc83dab21e29a595a04b2ab 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -151,7 +151,8 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
 
        while (!flist_empty(&td->io_log_list)) {
                int ret;
-               if (td->o.read_iolog_chunked) {
+
+               if (!td->io_log_blktrace && td->o.read_iolog_chunked) {
                        if (td->io_log_checkmark == td->io_log_current) {
                                if (!read_iolog2(td))
                                        return 1;
@@ -706,10 +707,13 @@ bool init_iolog(struct thread_data *td)
                 * Check if it's a blktrace file and load that if possible.
                 * Otherwise assume it's a normal log file and load that.
                 */
-               if (is_blktrace(fname, &need_swap))
+               if (is_blktrace(fname, &need_swap)) {
+                       td->io_log_blktrace = 1;
                        ret = load_blktrace(td, fname, need_swap);
-               else
+               } else {
+                       td->io_log_blktrace = 0;
                        ret = init_iolog_read(td, fname);
+               }
        } else if (td->o.write_iolog_file)
                ret = init_iolog_write(td);
        else