X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=stat.c;h=c9148ad7a73b321b08751353326e453581fbac59;hb=33477b4b5f61c2ba57bc3346b8968d9be8b56fc4;hp=a3fa8363b34dbf0e68e3dce4d1f92ed6f94ead04;hpb=78475ac3b9453eff01c34778d70a2aed4aecffe8;p=fio.git diff --git a/stat.c b/stat.c index a3fa8363..c9148ad7 100644 --- a/stat.c +++ b/stat.c @@ -669,6 +669,8 @@ static void show_thread_status_normal(struct thread_stat *ts, if (!ddir_rw_sum(ts->io_bytes) && !ddir_rw_sum(ts->total_io_u)) return; + + memset(time_buf, 0, sizeof(time_buf)); time(&time_p); os_ctime_r((const time_t *) &time_p, time_buf, sizeof(time_buf)); @@ -2020,7 +2022,7 @@ static void __add_log_sample(struct io_log *iolog, unsigned long val, s = get_sample(iolog, cur_log, cur_log->nr_samples); s->val = val; - s->time = t; + s->time = t + iolog->td->unix_epoch; io_sample_set_ddir(iolog, s, ddir); s->bs = bs; @@ -2234,7 +2236,7 @@ void add_clat_sample(struct thread_data *td, enum fio_ddir ddir, dst = malloc(sizeof(struct io_u_plat_entry)); memcpy(&(dst->io_u_plat), io_u_plat, FIO_IO_U_PLAT_NR * sizeof(unsigned int)); - flist_add(&dst->list, &hw->list.list); + flist_add(&dst->list, &hw->list); __add_log_sample(iolog, (unsigned long)dst, ddir, bs, elapsed, offset); @@ -2457,12 +2459,12 @@ int calc_log_samples(void) next = min(td->o.iops_avg_time, td->o.bw_avg_time); continue; } - if (!per_unit_log(td->bw_log)) { + if (td->bw_log && !per_unit_log(td->bw_log)) { tmp = add_bw_samples(td, &now); if (tmp < next) next = tmp; } - if (!per_unit_log(td->iops_log)) { + if (td->iops_log && !per_unit_log(td->iops_log)) { tmp = add_iops_samples(td, &now); if (tmp < next) next = tmp;