From: Jens Axboe Date: Thu, 5 Jun 2008 07:03:05 +0000 (+0200) Subject: Don't print 100% done, when we don't have a time estimate yet X-Git-Tag: fio-1.21-rc8~4 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0721d11e4d9807e40385e06b419824e9a875525c Don't print 100% done, when we don't have a time estimate yet Signed-off-by: Jens Axboe --- diff --git a/eta.c b/eta.c index bac3ddfd..601c9c7e 100644 --- a/eta.c +++ b/eta.c @@ -285,11 +285,17 @@ void print_thread_status(void) 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]; int ll; + if (!eta_sec) + strcpy(perc_str, "--- done"); + else + sprintf(perc_str, "%3.1f%% done", perc); + perc *= 100.0; - ll = printf(": [%s] [%3.1f%% done] [%6u/%6u kb/s] [eta %s]", - run_str, perc, rate[0], rate[1], eta_str); + ll = printf(": [%s] [%s] [%6u/%6u kb/s] [eta %s]", + run_str, perc_str, rate[0], rate[1], eta_str); if (ll >= 0 && ll < linelen_last) printf("%*s", linelen_last - ll, ""); linelen_last = ll;