Merge branch 'issue-1735' of https://github.com/yygcode/fio
authorVincent Fu <vincent.fu@samsung.com>
Fri, 22 Mar 2024 14:39:37 +0000 (10:39 -0400)
committerVincent Fu <vincent.fu@samsung.com>
Fri, 22 Mar 2024 14:39:37 +0000 (10:39 -0400)
* 'issue-1735' of https://github.com/yygcode/fio:
  iolog: fix disk stats issue

1  2 
iolog.c

diff --cc iolog.c
index 251e9d7fa2f8c4386b55fb2441229ae3cc9512de,aad6e09b8929ed4ca9541261b16c249a64313359..96af4f33e186dd4ec1a02b851a1c7ae4c0b1eaeb
+++ b/iolog.c
@@@ -798,22 -578,18 +798,24 @@@ 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(td->o.read_iolog_file, &need_swap))
 -                      ret = load_blktrace(td, td->o.read_iolog_file, need_swap);
 -              else
 -                      ret = init_iolog_read(td);
 +              if (is_blktrace(fname, &need_swap)) {
 +                      td->io_log_blktrace = 1;
 +                      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
 +              ret = true;
  
 -      if (ret)
 +      if (!ret)
                td_verror(td, EINVAL, "failed initializing iolog");
  
+       init_disk_util(td);
        return ret;
  }