X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=log.c;h=c44d8221ee936c4c0d235c87efa0f7607eca8dc7;hp=6fe4961255c710a0ccc82a3e2c66478eb0f334d9;hb=783500ad13ededece6c8912af1c937f990880e1f;hpb=77787c82d755cc8ab8fda82531dd648cfd127d8d diff --git a/log.c b/log.c index 6fe49612..c44d8221 100644 --- a/log.c +++ b/log.c @@ -8,6 +8,7 @@ #include #include "flist.h" #include "fio.h" +#include "verify.h" static const char iolog_ver2[] = "fio version 2 iolog"; @@ -19,7 +20,7 @@ void queue_io_piece(struct thread_data *td, struct io_piece *ipo) void log_io_u(struct thread_data *td, struct io_u *io_u) { - const char *act[] = { "read", "write", "sync" }; + const char *act[] = { "read", "write", "sync", "datasync" }; assert(io_u->ddir < 3); @@ -272,6 +273,8 @@ static int read_iolog2(struct thread_data *td, FILE *f) rw = DDIR_WRITE; else if (!strcmp(act, "sync")) rw = DDIR_SYNC; + else if (!strcmp(act, "datasync")) + rw = DDIR_DATASYNC; else { log_err("fio: bad iolog file action: %s\n", act); @@ -309,7 +312,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) if (read_only) continue; writes++; - } else if (rw != DDIR_SYNC && rw != DDIR_INVAL) { + } else if (!ddir_sync(rw)) { log_err("bad ddir: %d\n", rw); continue; } @@ -406,8 +409,6 @@ static int init_iolog_write(struct thread_data *td) return 1; } - printf("log opened\n"); - /* * That's it for writing, setup a log buffer and we're done. */ @@ -473,8 +474,10 @@ void __finish_log(struct io_log *log, const char *name) } for (i = 0; i < log->nr_samples; i++) { - fprintf(f, "%lu, %lu, %u\n", log->log[i].time, log->log[i].val, - log->log[i].ddir); + fprintf(f, "%lu, %lu, %u, %u\n", log->log[i].time, + log->log[i].val, + log->log[i].ddir, + log->log[i].bs); } fclose(f);