X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=iolog.c;h=65933672fa3e3da4ef8a5b59b6f70636f076a955;hp=e54016d6e6c1027b0e462043e914203a9b506ae9;hb=7d6be13abb5155045cd8b6bcd8a50fea5391a741;hpb=9db01ef976006c002b05fa4e4ec589eb029aac5b diff --git a/iolog.c b/iolog.c index e54016d6..65933672 100644 --- a/iolog.c +++ b/iolog.c @@ -315,6 +315,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) act); continue; } + fileno = get_fileno(td, fname); } else if (r == 2) { rw = DDIR_INVAL; if (!strcmp(act, "add")) { @@ -479,17 +480,22 @@ int init_iolog(struct thread_data *td) int ret = 0; if (td->o.read_iolog_file) { + int need_swap; + /* * 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); + if (is_blktrace(td->o.read_iolog_file, &need_swap)) + ret = load_blktrace(td, td->o.read_iolog_file, need_swap); else ret = init_iolog_read(td); } else if (td->o.write_iolog_file) ret = init_iolog_write(td); + if (ret) + td_verror(td, EINVAL, "failed initializing iolog"); + return ret; }