X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.c;h=16e19c8fa8e080511c6e07c96691c809e8955b0a;hp=1e69ce4228c624f3775a95e3299bde84c1e0baef;hb=f29b25a370598d387e539c3dcae126274c6cbf4d;hpb=b3f378e90231ecb2082ec565bafb3f721c4f1902 diff --git a/fio.c b/fio.c index 1e69ce42..16e19c8f 100644 --- a/fio.c +++ b/fio.c @@ -731,7 +731,7 @@ static int keep_running(struct thread_data *td) return 1; } - io_done = td->io_bytes[DDIR_READ] + td->io_bytes[DDIR_WRITE]; + io_done = td->io_bytes[DDIR_READ] + td->io_bytes[DDIR_WRITE] + td->io_skip_bytes; if (io_done < td->o.size) return 1; @@ -753,7 +753,8 @@ static int clear_io_state(struct thread_data *td) td->last_was_sync = 0; - td->nr_done_files = 0; + if (td->o.time_based) + td->nr_done_files = 0; for_each_file(td, f, i) td_io_close_file(td, f); @@ -920,8 +921,6 @@ static void *thread_main(void *data) finish_log(td, td->ts.slat_log, "slat"); if (td->ts.clat_log) finish_log(td, td->ts.clat_log, "clat"); - if (td->o.write_iolog_file) - write_iolog_close(td); if (td->o.exec_postrun) { if (system(td->o.exec_postrun) < 0) log_err("fio: postrun %s failed\n", td->o.exec_postrun); @@ -936,6 +935,13 @@ err: close_files(td); close_ioengine(td); cleanup_io_u(td); + + /* + * do this very late, it will log file closing as well + */ + if (td->o.write_iolog_file) + write_iolog_close(td); + options_mem_free(td); td_set_runstate(td, TD_EXITED); return (void *) (unsigned long) td->error;