X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=client.c;h=e70a27d95fc3154c01bdbbb9fb0fcc366384ecee;hp=af6621dc63d3e0ce7c196e1bd5daa0e747463a7d;hb=4904acd5c4ca5b4940fe198275c2afd339e623b8;hpb=25f488581e510c1b440f2e76842ec23f3dad7b57 diff --git a/client.c b/client.c index af6621dc..e70a27d9 100644 --- a/client.c +++ b/client.c @@ -987,7 +987,12 @@ void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je) dst->eta_sec = je->eta_sec; dst->nr_threads += je->nr_threads; - /* we need to handle je->run_str too ... */ + + /* + * This wont be correct for multiple strings, but at least it + * works for the basic cases. + */ + strcpy((char *) dst->run_str, (char *) je->run_str); } void fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op eta_fn) @@ -1149,9 +1154,9 @@ static struct cmd_iolog_pdu *convert_iolog_gz(struct fio_net_cmd *cmd, /* * Get header first, it's not compressed */ - nr_samples = le32_to_cpu(pdu->nr_samples); + nr_samples = le64_to_cpu(pdu->nr_samples); - total = nr_samples * sizeof(struct io_sample); + total = nr_samples * __log_entry_sz(le32_to_cpu(pdu->log_offset)); ret = malloc(total + sizeof(*pdu)); ret->nr_samples = nr_samples; @@ -1201,7 +1206,8 @@ static struct cmd_iolog_pdu *convert_iolog(struct fio_net_cmd *cmd) { struct cmd_iolog_pdu *pdu = (struct cmd_iolog_pdu *) cmd->payload; struct cmd_iolog_pdu *ret; - int i; + uint64_t i; + void *samples; /* * Convert if compressed and we support it. If it's not @@ -1220,18 +1226,27 @@ static struct cmd_iolog_pdu *convert_iolog(struct fio_net_cmd *cmd) } else ret = pdu; + ret->nr_samples = le64_to_cpu(ret->nr_samples); ret->thread_number = le32_to_cpu(ret->thread_number); - ret->nr_samples = le32_to_cpu(ret->nr_samples); ret->log_type = le32_to_cpu(ret->log_type); ret->compressed = le32_to_cpu(ret->compressed); + ret->log_offset = le32_to_cpu(ret->log_offset); + samples = &ret->samples[0]; for (i = 0; i < ret->nr_samples; i++) { - struct io_sample *s = &ret->samples[i]; + struct io_sample *s; + s = __get_sample(samples, ret->log_offset, i); s->time = le64_to_cpu(s->time); s->val = le64_to_cpu(s->val); s->ddir = le32_to_cpu(s->ddir); s->bs = le32_to_cpu(s->bs); + + if (ret->log_offset) { + struct io_sample_offset *so = (void *) s; + + so->offset = le64_to_cpu(so->offset); + } } return ret; @@ -1374,8 +1389,7 @@ static void request_client_etas(struct client_ops *ops) dprint(FD_NET, "client: request eta (%d)\n", nr_clients); - eta = malloc(sizeof(*eta)); - memset(&eta->eta, 0, sizeof(eta->eta)); + eta = calloc(1, sizeof(*eta) + __THREAD_RUNSTR_SZ(REAL_MAX_JOBS)); eta->pending = nr_clients; flist_for_each(entry, &client_list) {