client: only do le64_to_cpu() on io_sample_data member if iolog is histogram
authorTuan Hoang <tuan.hoang1@ibm.com>
Thu, 7 Jul 2022 07:53:52 +0000 (09:53 +0200)
committerTuan Hoang <tuan.hoang1@ibm.com>
Thu, 7 Jul 2022 07:53:52 +0000 (09:53 +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.

This has been done similarly in server code.

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

index 605a3ce573aa4c842df83c4947c823c03882fa03..37da74bca5d7eecb2d7f1530466de7a0c3b18627 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1702,7 +1702,8 @@ static struct cmd_iolog_pdu *convert_iolog(struct fio_net_cmd *cmd,
                        s = (struct io_sample *)((char *)s + sizeof(struct io_u_plat_entry) * i);
 
                s->time         = le64_to_cpu(s->time);
                        s = (struct io_sample *)((char *)s + sizeof(struct io_u_plat_entry) * i);
 
                s->time         = le64_to_cpu(s->time);
-               s->data.val     = le64_to_cpu(s->data.val);
+               if (ret->log_type != IO_LOG_TYPE_HIST)
+                       s->data.val     = le64_to_cpu(s->data.val);
                s->__ddir       = __le32_to_cpu(s->__ddir);
                s->bs           = le64_to_cpu(s->bs);
                s->priority     = le16_to_cpu(s->priority);
                s->__ddir       = __le32_to_cpu(s->__ddir);
                s->bs           = le64_to_cpu(s->bs);
                s->priority     = le16_to_cpu(s->priority);