#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
+#include <sys/sysmacros.h>
#include "flist.h"
#include "fio.h"
ios[DDIR_SYNC]++;
dprint(FD_BLKTRACE, "store flush delay=%lu\n", ipo->delay);
+
+ if (!(td->flags & TD_F_SYNCS))
+ td->flags |= TD_F_SYNCS;
+
queue_io_piece(td, ipo);
return true;
}
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;
}
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);
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;
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;
}