X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=iolog.c;h=82b2b8a3ec40084853655a42d5494a4e9bbf91bf;hp=dfa329fc2e75d7fc0191ada7d227d113762ec434;hb=18dc4295f53c83af3feba6861b5bdbaf09d720fe;hpb=bb1116fe9a53154447bb4305ed9d9fd42d2a6aa1 diff --git a/iolog.c b/iolog.c index dfa329fc..82b2b8a3 100644 --- a/iolog.c +++ b/iolog.c @@ -291,6 +291,18 @@ void unlog_io_piece(struct thread_data *td, struct io_u *io_u) { struct io_piece *ipo = io_u->ipo; + if (td->ts.nr_block_infos) { + uint32_t *info = io_u_block_info(td, io_u); + if (BLOCK_INFO_STATE(*info) < BLOCK_STATE_TRIM_FAILURE) { + if (io_u->ddir == DDIR_TRIM) + *info = BLOCK_INFO_SET_STATE(*info, + BLOCK_STATE_TRIM_FAILURE); + else if (io_u->ddir == DDIR_WRITE) + *info = BLOCK_INFO_SET_STATE(*info, + BLOCK_STATE_WRITE_FAILURE); + } + } + if (!ipo) return; @@ -933,12 +945,15 @@ int iolog_file_inflate(const char *file) #endif -void flush_log(struct io_log *log) +void flush_log(struct io_log *log, int do_append) { void *buf; FILE *f; - f = fopen(log->filename, "w"); + if (!do_append) + f = fopen(log->filename, "w"); + else + f = fopen(log->filename, "a"); if (!f) { perror("fopen log"); return; @@ -968,7 +983,7 @@ static int finish_log(struct thread_data *td, struct io_log *log, int trylock) if (td->client_type == FIO_CLIENT_TYPE_GUI) fio_send_iolog(td, log, log->filename); else - flush_log(log); + flush_log(log, !td->o.per_job_logs); fio_unlock_file(log->filename); free_log(log);