From 3b189ee6fae2cd1e1f78cc13b896b70eca9cc09a Mon Sep 17 00:00:00 2001 From: Tuan Hoang Date: Thu, 7 Jul 2022 09:53:52 +0200 Subject: [PATCH] client: only do le64_to_cpu() on io_sample_data member if iolog is histogram 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 Signed-off-by: Tuan Hoang --- client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 605a3ce5..37da74bc 100644 --- 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->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); -- 2.25.1