client/server: add missing fsync data structures
authorVincent Fu <vincent.fu@wdc.com>
Mon, 16 Dec 2019 15:15:11 +0000 (10:15 -0500)
committerVincent Fu <vincent.fu@wdc.com>
Tue, 17 Dec 2019 20:26:36 +0000 (15:26 -0500)
In client/server mode, fsync latencies were missing because a couple
data structures were missed in the client/server send/receive thread
stats code. This patch adds those data structures and now we are able to
see the fsync latencies in client/server mode.

Fixes: https://github.com/axboe/fio/issues/878
Signed-off-by: Vincent Fu <vincent.fu@wdc.com>
client.c
server.c

index e0047af06a3e97f6bdd57caeb4b3ebbd823956cd..55d89a0e54fd3696dc8685232f5e1fa02a5eb3da 100644 (file)
--- a/client.c
+++ b/client.c
@@ -960,6 +960,7 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
                convert_io_stat(&dst->bw_stat[i], &src->bw_stat[i]);
                convert_io_stat(&dst->iops_stat[i], &src->iops_stat[i]);
        }
+       convert_io_stat(&dst->sync_stat, &src->sync_stat);
 
        dst->usr_time           = le64_to_cpu(src->usr_time);
        dst->sys_time           = le64_to_cpu(src->sys_time);
@@ -994,8 +995,13 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
                for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
                        dst->io_u_plat[i][j] = le64_to_cpu(src->io_u_plat[i][j]);
 
-       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
+       for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
+               dst->io_u_sync_plat[j] = le64_to_cpu(src->io_u_sync_plat[j]);
+
+       for (i = 0; i < DDIR_RWDIR_SYNC_CNT; i++)
                dst->total_io_u[i]      = le64_to_cpu(src->total_io_u[i]);
+
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                dst->short_io_u[i]      = le64_to_cpu(src->short_io_u[i]);
                dst->drop_io_u[i]       = le64_to_cpu(src->drop_io_u[i]);
        }
index e7846227f2b19bebbb569d40676a9b288c696b2f..824f036ad606f448ca09f87ec90a06038040a0c2 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1490,6 +1490,7 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
                convert_io_stat(&p.ts.bw_stat[i], &ts->bw_stat[i]);
                convert_io_stat(&p.ts.iops_stat[i], &ts->iops_stat[i]);
        }
+       convert_io_stat(&p.ts.sync_stat, &ts->sync_stat);
 
        p.ts.usr_time           = cpu_to_le64(ts->usr_time);
        p.ts.sys_time           = cpu_to_le64(ts->sys_time);
@@ -1524,8 +1525,13 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
                for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
                        p.ts.io_u_plat[i][j] = cpu_to_le64(ts->io_u_plat[i][j]);
 
-       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
+       for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
+               p.ts.io_u_sync_plat[j] = cpu_to_le64(ts->io_u_sync_plat[j]);
+
+       for (i = 0; i < DDIR_RWDIR_SYNC_CNT; i++)
                p.ts.total_io_u[i]      = cpu_to_le64(ts->total_io_u[i]);
+
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                p.ts.short_io_u[i]      = cpu_to_le64(ts->short_io_u[i]);
                p.ts.drop_io_u[i]       = cpu_to_le64(ts->drop_io_u[i]);
        }