server: only do cpu_to_le64() on io_sample_data member if iolog is histogram
authorTuan Hoang <tuan.hoang1@ibm.com>
Wed, 6 Jul 2022 22:35:09 +0000 (00:35 +0200)
committerTuan Hoang <tuan.hoang1@ibm.com>
Wed, 6 Jul 2022 22:35:09 +0000 (00:35 +0200)
In the case of histogram iolog, the union io_sample_data member is a
pointer of struct io_u_plat_entry, while in the case of normal iolog, it
is an uint64_t. Thus only need to do the byteswap in case it is an
uint64_t.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Tuan Hoang <tuan.hoang1@ibm.com>
server.c

index 4c71bd449458aa44ecb65d43ea787962eba34058..b453be5fc38b85c73627915eb78895cb1239b933 100644 (file)
--- a/server.c
+++ b/server.c
@@ -2284,7 +2284,8 @@ int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
                        struct io_sample *s = get_sample(log, cur_log, i);
 
                        s->time         = cpu_to_le64(s->time);
-                       s->data.val     = cpu_to_le64(s->data.val);
+                       if (log->log_type != IO_LOG_TYPE_HIST)
+                               s->data.val     = cpu_to_le64(s->data.val);
                        s->__ddir       = __cpu_to_le32(s->__ddir);
                        s->bs           = cpu_to_le64(s->bs);