docs: update for new data placement options
[fio.git] / blktrace.c
index ead601304703d216dacee410b565e88d16eee929..ef9ce6bffd8686e1e5f5e7bf4f00828490495c2c 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
+#include <sys/sysmacros.h>
 
 #include "flist.h"
 #include "fio.h"
@@ -313,25 +314,14 @@ static bool queue_trace(struct thread_data *td, struct blk_io_trace *t,
                         unsigned long *ios, unsigned long long *bs,
                         struct file_cache *cache)
 {
-       unsigned long long *last_ttime = &td->io_log_blktrace_last_ttime;
+       unsigned long long *last_ttime = &td->io_log_last_ttime;
        unsigned long long delay = 0;
 
        if ((t->action & 0xffff) != __BLK_TA_QUEUE)
                return false;
 
        if (!(t->action & BLK_TC_ACT(BLK_TC_NOTIFY))) {
-               if (!*last_ttime || td->o.no_stall || t->time < *last_ttime)
-                       delay = 0;
-               else if (td->o.replay_time_scale == 100)
-                       delay = t->time - *last_ttime;
-               else {
-                       double tmp = t->time - *last_ttime;
-                       double scale;
-
-                       scale = (double) 100.0 / (double) td->o.replay_time_scale;
-                       tmp *= scale;
-                       delay = tmp;
-               }
+               delay = delay_since_ttime(td, t->time);
                *last_ttime = t->time;
        }
 
@@ -422,7 +412,7 @@ bool init_blktrace_read(struct thread_data *td, const char *filename, int need_s
                goto err;
        }
        td->io_log_blktrace_swap = need_swap;
-       td->io_log_blktrace_last_ttime = 0;
+       td->io_log_last_ttime = 0;
        td->o.size = 0;
 
        free_release_files(td);
@@ -453,7 +443,10 @@ err:
 bool read_blktrace(struct thread_data* td)
 {
        struct blk_io_trace t;
-       struct file_cache cache = { };
+       struct file_cache cache = {
+               .maj = ~0U,
+               .min = ~0U,
+       };
        unsigned long ios[DDIR_RWDIR_SYNC_CNT] = { };
        unsigned long long rw_bs[DDIR_RWDIR_CNT] = { };
        unsigned long skipped_writes;
@@ -553,7 +546,8 @@ bool read_blktrace(struct thread_data* td)
                        td->o.max_bs[DDIR_TRIM] = max(td->o.max_bs[DDIR_TRIM], rw_bs[DDIR_TRIM]);
                        io_u_quiesce(td);
                        free_io_mem(td);
-                       init_io_u_buffers(td);
+                       if (init_io_u_buffers(td))
+                               return false;
                }
                return true;
        }