- 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;
+ for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) {
+ rate_str[ddir] = num2str(je->rate[ddir], 5,
+ 1024, je->is_pow2, je->unit_base);
+ iops_str[ddir] = num2str(je->iops[ddir], 4, 1, 0, 0);
+ }
+
+ left = sizeof(output) - (p - output) - 1;
+
+ l = snprintf(p, left, ": [%s] [%s] [%s/%s/%s /s] [%s/%s/%s iops] [eta %s]",
+ je->run_str, perc_str, rate_str[DDIR_READ],
+ rate_str[DDIR_WRITE], rate_str[DDIR_TRIM],
+ iops_str[DDIR_READ], iops_str[DDIR_WRITE],
+ iops_str[DDIR_TRIM], eta_str);
+ p += l;
+ if (l >= 0 && l < linelen_last)
+ p += sprintf(p, "%*s", linelen_last - l, "");
+ linelen_last = l;
+
+ for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++) {
+ free(rate_str[ddir]);
+ free(iops_str[ddir]);
+ }