X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=log.c;h=8f92e93f065d7b57234bbdbccf8bab875f785fe9;hp=63c0a332d6bb6680998cbfd81a186d0ff6f24a3e;hb=ec996e9c8f3baacababec55b3be746e035099c14;hpb=f718273e7180208fc0cf5c88b99f32b371d6d75f diff --git a/log.c b/log.c index 63c0a332..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]); } @@ -334,15 +341,6 @@ static int read_iolog2(struct thread_data *td, FILE *f) return 0; } -/* - * Read version 1 iolog data. - */ -static int read_iolog(struct thread_data *td, FILE *f) -{ - log_err("fio: iolog version 1 is no longer supported\n"); - return 1; -} - /* * open iolog, check version, and call appropriate parser */ @@ -372,16 +370,8 @@ static int init_iolog_read(struct thread_data *td) if (!strncmp(iolog_ver2, buffer, strlen(iolog_ver2))) ret = read_iolog2(td, f); else { - /* - * seek back to the beginning - */ - if (fseek(f, 0, SEEK_SET) < 0) { - td_verror(td, errno, "iolog read"); - log_err("fio: unable to read iolog\n"); - return 1; - } - - ret = read_iolog(td, f); + log_err("fio: iolog version 1 is no longer supported\n"); + ret = 1; } fclose(f); @@ -482,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, "client%d_%s.log", td->thread_number, name); - __finish_log(log, file_name); + snprintf(file_name, 200, "%s_%s.log", td->o.name, name); + p = basename(file_name); + __finish_log(log, p); }