}
ipo = malloc(sizeof(*ipo));
+ memset(ipo, 0, sizeof(*ipo));
INIT_LIST_HEAD(&ipo->list);
ipo->offset = offset;
ipo->len = bytes;
{
FILE *f;
+ if (td->o.nr_files > 1) {
+ log_err("fio: write_iolog only works with 1 file currently\n");
+ return 1;
+ }
+
f = fopen(td->o.write_iolog_file, "w+");
if (!f) {
perror("fopen write iolog");
if (td->io_ops->flags & FIO_DISKLESSIO)
return 0;
- if (td->o.read_iolog_file)
- ret = init_iolog_read(td);
- else if (td->o.write_iolog_file)
+ if (td->o.read_iolog_file) {
+ /*
+ * 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))
+ ret = load_blktrace(td, td->o.read_iolog_file);
+ else
+ ret = init_iolog_read(td);
+ } else if (td->o.write_iolog_file)
ret = init_iolog_write(td);
return ret;