*/
#include <stdio.h>
#include <stdlib.h>
-#include <sys/stat.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
-#include <dirent.h>
#include "flist.h"
#include "fio.h"
+#include "blktrace.h"
#include "blktrace_api.h"
-#include "lib/linux-dev-lookup.h"
+#include "oslib/linux-dev-lookup.h"
#define TRACE_FIFO_SIZE 8192
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 - 1);
-}
-
-
/*
* 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_bytes_align(&td->o, ipo);
+ ipo_bytes_align(td->o.replay_align, ipo);
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_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;
handle_trace(td, &t, ios, rw_bs);
} while (1);
- for (i = 0; i < td->files_index; i++) {
- f = td->files[i];
+ for_each_file(td, f, i)
trace_add_open_close_event(td, f->fileno, FIO_LOG_CLOSE_FILE);
- }
fifo_free(fifo);
close(fd);