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--;
}
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;
} else
f = fopen(fname, "r");
- free(fname);
-
if (!f) {
perror("fopen read iolog");
return false;
*/
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);
}
+ free(fname);
} else if (td->o.write_iolog_file)
ret = init_iolog_write(td);
else