[PATCH 2/7] trim_verify: include a trim panel in the output

Vincent Fu <[email protected]>
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
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 <[email protected]>
---
 backend.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backend.c b/backend.c
index b75eea80..f2a4ad35 100644
--- a/backend.c
+++ b/backend.c
@@ -1994,7 +1994,8 @@ static void *thread_main(void *data)
 			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);
-- 
2.47.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.