X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=eta.c;h=8dbff985cac272795038a53d21ff14037fd6e825;hp=492609bf0d5aabdbdcd3b15f11be8a51883a2aeb;hb=56075b96f307f8276f9d032ac8404622b94a456c;hpb=adb02ba8e05ccbb1c1985791d0ee52828bcbf6aa diff --git a/eta.c b/eta.c index 492609bf..8dbff985 100644 --- a/eta.c +++ b/eta.c @@ -168,8 +168,8 @@ static int thread_eta(struct thread_data *td) t_eta -= ramp_left; } } - if (td->o.rate) { - r_eta = (bytes_total / 1024) / td->o.rate; + if (td->o.rate[0] || td->o.rate[1]) { + r_eta = (bytes_total / 1024) / (td->o.rate[0] + td->o.rate[1]); r_eta += td->o.start_delay; } @@ -232,6 +232,7 @@ void print_thread_status(void) static unsigned int rate[2], iops[2]; static int linelen_last; static int eta_good; + int i2p = 0; if (temp_stall_ts || terse_output || eta_print == FIO_ETA_NEVER) return; @@ -260,10 +261,10 @@ void print_thread_status(void) || td->runstate == TD_FSYNCING || td->runstate == TD_PRE_READING) { nr_running++; - t_rate += td->o.rate; - m_rate += td->o.ratemin; - t_iops += td->o.rate_iops; - m_iops += td->o.rate_iops_min; + t_rate += td->o.rate[0] + td->o.rate[1]; + m_rate += td->o.ratemin[0] + td->o.ratemin[1]; + t_iops += td->o.rate_iops[0] + td->o.rate_iops[1]; + m_iops += td->o.rate_iops_min[0] + td->o.rate_iops_min[1]; files_open += td->nr_open_files; } else if (td->runstate == TD_RAMP) { nr_running++; @@ -292,6 +293,8 @@ void print_thread_status(void) eta_sec = 0; for_each_td(td, i) { + if (!i2p && is_power_of_2(td->o.kb_base)) + i2p = 1; if (exitall_on_terminate) { if (eta_secs[i] < eta_sec) eta_sec = eta_secs[i]; @@ -331,13 +334,20 @@ void print_thread_status(void) return; printf("Jobs: %d (f=%d)", nr_running, files_open); - if (m_rate || t_rate) - printf(", CR=%d/%d KiB/s", t_rate, m_rate); - else if (m_iops || t_iops) + if (m_rate || t_rate) { + char *tr, *mr; + + mr = num2str(m_rate, 4, 0, i2p); + tr = num2str(t_rate, 4, 0, i2p); + printf(", CR=%s/%s KB/s", tr, mr); + free(tr); + free(mr); + } else if (m_iops || t_iops) printf(", CR=%d/%d IOPS", t_iops, m_iops); if (eta_sec != INT_MAX && nr_running) { char perc_str[32]; char *iops_str[2]; + char *rate_str[2]; int l; if ((!eta_sec && !eta_good) || nr_ramp == nr_running) @@ -348,15 +358,21 @@ void print_thread_status(void) sprintf(perc_str, "%3.1f%% done", perc); } + rate_str[0] = num2str(rate[0], 5, 10, i2p); + rate_str[1] = num2str(rate[1], 5, 10, i2p); + iops_str[0] = num2str(iops[0], 4, 1, 0); iops_str[1] = num2str(iops[1], 4, 1, 0); - l = printf(": [%s] [%s] [%6u/%6u kb/s] [%s/%s iops] [eta %s]", - run_str, perc_str, rate[0], rate[1], + l = printf(": [%s] [%s] [%s/%s /s] [%s/%s iops] [eta %s]", + run_str, perc_str, rate_str[0], rate_str[1], iops_str[0], iops_str[1], eta_str); if (l >= 0 && l < linelen_last) printf("%*s", linelen_last - l, ""); linelen_last = l; + + free(rate_str[0]); + free(rate_str[1]); free(iops_str[0]); free(iops_str[1]); }