blktrace.c: Add support for read_iolog_chunked
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index 1aeb7a76b2b6ca21ab8bd3d5c18e5ec200669fcb..5a41e93fa2644ab98e8a3cf5f24e308aaa05c5b1 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -152,10 +152,15 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
        while (!flist_empty(&td->io_log_list)) {
                int ret;
 
-               if (!td->io_log_blktrace && td->o.read_iolog_chunked) {
+               if (td->o.read_iolog_chunked) {
                        if (td->io_log_checkmark == td->io_log_current) {
-                               if (!read_iolog2(td))
-                                       return 1;
+                               if (td->io_log_blktrace) {
+                                       if (!read_blktrace(td))
+                                               return 1;
+                               } else {
+                                       if (!read_iolog2(td))
+                                               return 1;
+                               }
                        }
                        td->io_log_current--;
                }
@@ -355,7 +360,7 @@ void write_iolog_close(struct thread_data *td)
        td->iolog_buf = NULL;
 }
 
-static int64_t iolog_items_to_fetch(struct thread_data *td)
+int64_t iolog_items_to_fetch(struct thread_data *td)
 {
        struct timespec now;
        uint64_t elapsed;
@@ -709,7 +714,7 @@ bool init_iolog(struct thread_data *td)
                 */
                if (is_blktrace(fname, &need_swap)) {
                        td->io_log_blktrace = 1;
-                       ret = load_blktrace(td, fname, need_swap);
+                       ret = init_blktrace_read(td, fname, need_swap);
                } else {
                        td->io_log_blktrace = 0;
                        ret = init_iolog_read(td, fname);