client: fix ETA run_str
authorJens Axboe <axboe@fb.com>
Fri, 27 Jun 2014 21:30:06 +0000 (15:30 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 27 Jun 2014 21:30:06 +0000 (15:30 -0600)
We never touched it before, which meant the client would just
display an empty string. Make a valiant effort to allocate and
output the run_str.

Signed-off-by: Jens Axboe <axboe@fb.com>
client.c

index af6621dc63d3e0ce7c196e1bd5daa0e747463a7d..828dd97b0b355c079fc978e9f65baa07ef37aa54 100644 (file)
--- 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;
                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)
 }
 
 void fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op eta_fn)
@@ -1374,8 +1379,7 @@ static void request_client_etas(struct client_ops *ops)
 
        dprint(FD_NET, "client: request eta (%d)\n", nr_clients);
 
 
        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) {
        eta->pending = nr_clients;
 
        flist_for_each(entry, &client_list) {