- 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;
+ if (je->rate[DDIR_TRIM] || je->iops[DDIR_TRIM])
+ l = snprintf(p, left,
+ ": [%s][%s][r=%s,w=%s,t=%s][r=%s,w=%s,t=%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);
+ else
+ l = snprintf(p, left,
+ ": [%s][%s][r=%s,w=%s][r=%s,w=%s IOPS][eta %s]",
+ je->run_str, perc_str,
+ rate_str[DDIR_READ], rate_str[DDIR_WRITE],
+ iops_str[DDIR_READ], iops_str[DDIR_WRITE],
+ eta_str);
+ /* If truncation occurred adjust l so p is on the null */
+ if (l >= left)
+ l = left - 1;
+ p += l;
+ linelen = p - output;
+ if (l >= 0 && linelen < linelen_last)
+ p += sprintf(p, "%*s", linelen_last - linelen, "");
+ linelen_last = linelen;
+
+ for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
+ free(rate_str[ddir]);
+ free(iops_str[ddir]);
+ }
+ }
+ p += sprintf(p, "\r");
+
+ printf("%s", output);