X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=log.c;h=8f92e93f065d7b57234bbdbccf8bab875f785fe9;hb=838bc709279964bdcc64070d4eb2777a0f79bcbb;hp=15de3c24d10bf64698325479af7e5b45f80c81aa;hpb=aec2de209564a6951e6c91d653fc99a75508607d;p=fio.git diff --git a/log.c b/log.c index 15de3c24..8f92e93f 100644 --- a/log.c +++ b/log.c @@ -40,6 +40,13 @@ void log_file(struct thread_data *td, struct fio_file *f, if (!td->o.write_iolog_file) return; + + /* + * this happens on the pre-open/close done before the job starts + */ + if (!td->iolog_f) + return; + fprintf(td->iolog_f, "%s %s\n", f->file_name, act[what]); } @@ -465,8 +472,9 @@ void __finish_log(struct io_log *log, const char *name) void finish_log(struct thread_data *td, struct io_log *log, const char *name) { - char file_name[256]; + char file_name[256], *p; snprintf(file_name, 200, "%s_%s.log", td->o.name, name); - __finish_log(log, file_name); + p = basename(file_name); + __finish_log(log, p); }