X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=stat.c;h=949af5edd49ffa05dfa16bbef70c7d1037de8261;hb=0fc3cb4cd767bca150601a9d07fcdd57e4c50373;hp=1764eebc697ab52bc467a4dc922b93e01f5422e9;hpb=e23aa8174d6a1242d81491ce30f10a8d5f9acb10;p=fio.git diff --git a/stat.c b/stat.c index 1764eebc..949af5ed 100644 --- a/stat.c +++ b/stat.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -377,7 +378,7 @@ void show_group_stats(struct group_run_stats *rs, struct buf_output *out) free(maxalt); } - /* Need to aggregate statisitics to show mixed values */ + /* Need to aggregate statistics to show mixed values */ if (rs->unified_rw_rep == UNIFIED_BOTH) show_mixed_group_stats(rs, out); } @@ -1698,6 +1699,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts, if (je) { json_object_add_value_int(root, "eta", je->eta_sec); json_object_add_value_int(root, "elapsed", je->elapsed_sec); + free(je); } if (opt_list) @@ -2731,6 +2733,9 @@ int __show_running_run_stats(void) fio_gettime(&ts, NULL); for_each_td(td, i) { + if (td->runstate >= TD_EXITED) + continue; + td->update_rusage = 1; for_each_rw_ddir(ddir) { td->ts.io_bytes[ddir] = td->io_bytes[ddir]; @@ -2759,6 +2764,9 @@ int __show_running_run_stats(void) __show_run_stats(); for_each_td(td, i) { + if (td->runstate >= TD_EXITED) + continue; + if (td_read(td) && td->ts.io_bytes[DDIR_READ]) td->ts.runtime[DDIR_READ] -= rt[i]; if (td_write(td) && td->ts.io_bytes[DDIR_WRITE])