The trim bit in td_ddir is not set when trim_percentage/backlog is
enabled yet fio still issues trim operations. Detect these cases and
produce output describing trim operations if we issued any.
This is similar to the fix (
615c794cbf851c994e94fffe8b8f565e64f137a5)
committed for verify_backlog.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
update_runtime(td, elapsed_us, DDIR_READ);
if (td_write(td) && td->io_bytes[DDIR_WRITE])
update_runtime(td, elapsed_us, DDIR_WRITE);
- if (td_trim(td) && td->io_bytes[DDIR_TRIM])
+ if (td->io_bytes[DDIR_TRIM] && (td_trim(td) ||
+ ((td->flags & TD_F_TRIM_BACKLOG) && td_write(td))))
update_runtime(td, elapsed_us, DDIR_TRIM);
fio_gettime(&td->start, NULL);
fio_sem_up(stat_sem);