Enable replay_scale (and replay_align) when playing back fio's log
format by making ipo_bytes_align() available from a header.
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
t->bytes = (t->bytes + o->replay_align - 1) & ~(o->replay_align - 1);
}
t->bytes = (t->bytes + o->replay_align - 1) & ~(o->replay_align - 1);
}
-static void ipo_bytes_align(struct thread_options *o, struct io_piece *ipo)
-{
- if (!o->replay_align)
- return;
-
- ipo->offset &= ~(o->replay_align - (uint64_t)1);
-}
-
-
/*
* Store blk_io_trace data in an ipo for later retrieval.
*/
/*
* Store blk_io_trace data in an ipo for later retrieval.
*/
ipo->offset = offset * bs;
if (td->o.replay_scale)
ipo->offset = ipo->offset / td->o.replay_scale;
ipo->offset = offset * bs;
if (td->o.replay_scale)
ipo->offset = ipo->offset / td->o.replay_scale;
- ipo_bytes_align(&td->o, ipo);
+ ipo_bytes_align(td->o.replay_align, ipo);
ipo->len = bytes;
ipo->delay = ttime / 1000;
if (rw)
ipo->len = bytes;
ipo->delay = ttime / 1000;
if (rw)
ipo->offset = t->sector * bs;
if (td->o.replay_scale)
ipo->offset = ipo->offset / td->o.replay_scale;
ipo->offset = t->sector * bs;
if (td->o.replay_scale)
ipo->offset = ipo->offset / td->o.replay_scale;
- ipo_bytes_align(&td->o, ipo);
+ ipo_bytes_align(td->o.replay_align, ipo);
ipo->len = t->bytes;
ipo->delay = ttime / 1000;
ipo->ddir = DDIR_TRIM;
ipo->len = t->bytes;
ipo->delay = ttime / 1000;
ipo->ddir = DDIR_TRIM;
if (rw == DDIR_WAIT) {
ipo->delay = offset;
} else {
if (rw == DDIR_WAIT) {
ipo->delay = offset;
} else {
+ if (td->o.replay_scale)
+ ipo->offset = offset / td->o.replay_scale;
+ else
+ ipo->offset = offset;
+ ipo_bytes_align(td->o.replay_align, ipo);
+
ipo->len = bytes;
if (rw != DDIR_INVAL && bytes > td->o.max_bs[rw])
td->o.max_bs[rw] = bytes;
ipo->len = bytes;
if (rw != DDIR_INVAL && bytes > td->o.max_bs[rw])
td->o.max_bs[rw] = bytes;
log->log_type == IO_LOG_TYPE_SLAT;
}
log->log_type == IO_LOG_TYPE_SLAT;
}
+static inline void ipo_bytes_align(unsigned int replay_align, struct io_piece *ipo)
+{
+ if (replay_align)
+ return;
+
+ ipo->offset &= ~(replay_align - (uint64_t)1);
+}
+
extern void finalize_logs(struct thread_data *td, bool);
extern void setup_log(struct io_log **, struct log_params *, const char *);
extern void flush_log(struct io_log *, bool);
extern void finalize_logs(struct thread_data *td, bool);
extern void setup_log(struct io_log **, struct log_params *, const char *);
extern void flush_log(struct io_log *, bool);