X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=log.c;h=dd63c3891b67c65d6fd2903b8bfab0d349a246cb;hp=a4f4c7801d0fa92671bd4b67ee8798b7f0f88924;hb=faf5c880f6ddcd44ff896ba1cf3da38b23fe0f39;hpb=fb44a18f1bd81b26c3d483c79f5707085bda24dc diff --git a/log.c b/log.c index a4f4c780..dd63c389 100644 --- a/log.c +++ b/log.c @@ -5,7 +5,7 @@ void write_iolog_put(struct thread_data *td, struct io_u *io_u) { - fprintf(td->iolog_f, "%u,%llu,%u\n", io_u->ddir, io_u->offset, io_u->buflen); + fprintf(td->iolog_f, "%u,%llu,%lu\n", io_u->ddir, io_u->offset, io_u->buflen); } int read_iolog_get(struct thread_data *td, struct io_u *io_u) @@ -218,14 +218,12 @@ void setup_log(struct io_log **log) *log = l; } -void finish_log(struct thread_data *td, struct io_log *log, const char *name) +void __finish_log(struct io_log *log, const char *name) { - char file_name[256]; - FILE *f; unsigned int i; + FILE *f; - snprintf(file_name, 200, "client%d_%s.log", td->thread_number, name); - f = fopen(file_name, "w"); + f = fopen(name, "w"); if (!f) { perror("fopen log"); return; @@ -238,3 +236,11 @@ void finish_log(struct thread_data *td, struct io_log *log, const char *name) free(log->log); free(log); } + +void finish_log(struct thread_data *td, struct io_log *log, const char *name) +{ + char file_name[256]; + + snprintf(file_name, 200, "client%d_%s.log", td->thread_number, name); + __finish_log(log, file_name); +}