X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=eta.c;h=066a732f23a211cdc167e0f6419c75d751cc1390;hp=075ce8c81a010b1e57e0a7d31d5c8f7259b69a47;hb=836fcc0fceb233ebcc41ee63b4ea5cae20b678a4;hpb=f3afa57e36550288340f1b6c694f354ae72654b9 diff --git a/eta.c b/eta.c index 075ce8c8..066a732f 100644 --- a/eta.c +++ b/eta.c @@ -78,6 +78,7 @@ static void check_str_update(struct thread_data *td) c = 'C'; break; case TD_INITIALIZED: + case TD_SETTING_UP: c = 'I'; break; case TD_NOT_CREATED: @@ -93,7 +94,7 @@ static void check_str_update(struct thread_data *td) /* * Convert seconds to a printable string. */ -static void eta_to_str(char *str, unsigned long eta_sec) +void eta_to_str(char *str, unsigned long eta_sec) { unsigned int d, h, m, s; int disp_hour = 0; @@ -139,13 +140,19 @@ static int thread_eta(struct thread_data *td) } /* - * if writing, bytes_total will be twice the size. If mixing, - * assume a 50/50 split and thus bytes_total will be 50% larger. + * if writing and verifying afterwards, bytes_total will be twice the + * size. In a mixed workload, verify phase will be the size of the + * first stage writes. */ if (td->o.do_verify && td->o.verify && td_write(td)) { - if (td_rw(td)) - bytes_total = bytes_total * 3 / 2; - else + if (td_rw(td)) { + unsigned int perc = 50; + + if (td->o.rwmix[DDIR_WRITE]) + perc = td->o.rwmix[DDIR_WRITE]; + + bytes_total += (bytes_total * perc) / 100; + } else bytes_total <<= 1; } @@ -296,29 +303,31 @@ int calc_thread_status(struct jobs_eta *je, int force) || td->runstate == TD_PRE_READING) { je->nr_running++; if (td_read(td)) { - je->t_rate += td->o.rate[DDIR_READ]; - je->t_iops += td->o.rate_iops[DDIR_READ]; - je->m_rate += td->o.ratemin[DDIR_READ]; - je->m_iops += td->o.rate_iops_min[DDIR_READ]; + je->t_rate[0] += td->o.rate[DDIR_READ]; + je->t_iops[0] += td->o.rate_iops[DDIR_READ]; + je->m_rate[0] += td->o.ratemin[DDIR_READ]; + je->m_iops[0] += td->o.rate_iops_min[DDIR_READ]; } if (td_write(td)) { - je->t_rate += td->o.rate[DDIR_WRITE]; - je->t_iops += td->o.rate_iops[DDIR_WRITE]; - je->m_rate += td->o.ratemin[DDIR_WRITE]; - je->m_iops += td->o.rate_iops_min[DDIR_WRITE]; + je->t_rate[1] += td->o.rate[DDIR_WRITE]; + je->t_iops[1] += td->o.rate_iops[DDIR_WRITE]; + je->m_rate[1] += td->o.ratemin[DDIR_WRITE]; + je->m_iops[1] += td->o.rate_iops_min[DDIR_WRITE]; } if (td_trim(td)) { - je->t_rate += td->o.rate[DDIR_TRIM]; - je->t_iops += td->o.rate_iops[DDIR_TRIM]; - je->m_rate += td->o.ratemin[DDIR_TRIM]; - je->m_iops += td->o.rate_iops_min[DDIR_TRIM]; + je->t_rate[2] += td->o.rate[DDIR_TRIM]; + je->t_iops[2] += td->o.rate_iops[DDIR_TRIM]; + je->m_rate[2] += td->o.ratemin[DDIR_TRIM]; + je->m_iops[2] += td->o.rate_iops_min[DDIR_TRIM]; } je->files_open += td->nr_open_files; } else if (td->runstate == TD_RAMP) { je->nr_running++; je->nr_ramp++; - } else if (td->runstate < TD_RUNNING) + } else if (td->runstate == TD_SETTING_UP) + je->nr_running++; + else if (td->runstate < TD_RUNNING) je->nr_pending++; if (je->elapsed_sec >= 3) @@ -401,16 +410,19 @@ void display_thread_status(struct jobs_eta *je) } p += sprintf(p, "Jobs: %d (f=%d)", je->nr_running, je->files_open); - if (je->m_rate || je->t_rate) { + if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) { char *tr, *mr; - mr = num2str(je->m_rate, 4, 0, je->is_pow2); - tr = num2str(je->t_rate, 4, 0, je->is_pow2); + mr = num2str(je->m_rate[0] + je->m_rate[1], 4, 0, je->is_pow2); + tr = num2str(je->t_rate[0] + je->t_rate[1], 4, 0, je->is_pow2); p += sprintf(p, ", CR=%s/%s KB/s", tr, mr); free(tr); free(mr); - } else if (je->m_iops || je->t_iops) - p += sprintf(p, ", CR=%d/%d IOPS", je->t_iops, je->m_iops); + } else if (je->m_iops[0] || je->m_iops[1] || je->t_iops[0] || je->t_iops[1]) { + p += sprintf(p, ", CR=%d/%d IOPS", + je->t_iops[0] + je->t_iops[1], + je->m_iops[0] + je->m_iops[1]); + } if (je->eta_sec != INT_MAX && je->nr_running) { char perc_str[32]; char *iops_str[DDIR_RWDIR_CNT];