X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=iolog.c;h=cfcab2712d1026e20a71c27dcc2428a1a76923f2;hb=e75cc8f3a296fe5910eee9b7f25cc8cb524b4518;hp=f9e835d4b087aa17755d41f76a59d6cf0bb95c7e;hpb=38ef9c90fbe4fddc209f94b277b49e78f7f6a424;p=fio.git diff --git a/iolog.c b/iolog.c index f9e835d4..cfcab271 100644 --- a/iolog.c +++ b/iolog.c @@ -30,17 +30,12 @@ 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", "datasync", - "sync_file_range", "wait", "trim" }; - - assert(io_u->ddir <= 6); - if (!td->o.write_iolog_file) return; fprintf(td->iolog_f, "%s %s %llu %lu\n", io_u->file->file_name, - act[io_u->ddir], io_u->offset, - io_u->buflen); + io_ddir_name(io_u->ddir), + io_u->offset, io_u->buflen); } void log_file(struct thread_data *td, struct fio_file *f, @@ -544,9 +539,9 @@ int init_iolog(struct thread_data *td) void setup_log(struct io_log **log, struct log_params *p, const char *filename) { - struct io_log *l = malloc(sizeof(*l)); + struct io_log *l; - memset(l, 0, sizeof(*l)); + l = calloc(1, sizeof(*l)); l->nr_samples = 0; l->max_samples = 1024; l->log_type = p->log_type;