Merge branch 'master' into gfio
[fio.git] / init.c
diff --git a/init.c b/init.c
index 61b3d4b15839b39b9cb4c825fb7294fb21871e7e..2d10498b2eaa31ab0f355c77e0c11fa1cc115f8b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -583,7 +583,7 @@ static int fixup_options(struct thread_data *td)
 /*
  * This function leaks the buffer
  */
-static char *to_kmg(unsigned int val)
+char *fio_uint_to_kmg(unsigned int val)
 {
        char *buf = malloc(32);
        char post[] = { 0, 'K', 'M', 'G', 'P', 'E', 0 };
@@ -846,14 +846,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                goto err;
 
        if (td->o.write_lat_log) {
-               setup_log(&td->lat_log, td->o.log_avg_msec);
-               setup_log(&td->slat_log, td->o.log_avg_msec);
-               setup_log(&td->clat_log, td->o.log_avg_msec);
+               setup_log(&td->lat_log, td->o.log_avg_msec, IO_LOG_TYPE_LAT);
+               setup_log(&td->slat_log, td->o.log_avg_msec, IO_LOG_TYPE_SLAT);
+               setup_log(&td->clat_log, td->o.log_avg_msec, IO_LOG_TYPE_CLAT);
        }
        if (td->o.write_bw_log)
-               setup_log(&td->bw_log, td->o.log_avg_msec);
+               setup_log(&td->bw_log, td->o.log_avg_msec, IO_LOG_TYPE_BW);
        if (td->o.write_iops_log)
-               setup_log(&td->iops_log, td->o.log_avg_msec);
+               setup_log(&td->iops_log, td->o.log_avg_msec, IO_LOG_TYPE_IOPS);
 
        if (!td->o.name)
                td->o.name = strdup(jobname);
@@ -861,7 +861,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
        if (!terse_output) {
                if (!job_add_num) {
                        if (is_backend && !recursed)
-                               fio_server_send_add_job(&td->o, td->io_ops->name);
+                               fio_server_send_add_job(td);
 
                        if (!strcmp(td->io_ops->name, "cpuio")) {
                                log_info("%s: ioengine=cpu, cpuload=%u,"
@@ -871,10 +871,10 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                        } else {
                                char *c1, *c2, *c3, *c4;
 
-                               c1 = to_kmg(td->o.min_bs[DDIR_READ]);
-                               c2 = to_kmg(td->o.max_bs[DDIR_READ]);
-                               c3 = to_kmg(td->o.min_bs[DDIR_WRITE]);
-                               c4 = to_kmg(td->o.max_bs[DDIR_WRITE]);
+                               c1 = fio_uint_to_kmg(td->o.min_bs[DDIR_READ]);
+                               c2 = fio_uint_to_kmg(td->o.max_bs[DDIR_READ]);
+                               c3 = fio_uint_to_kmg(td->o.min_bs[DDIR_WRITE]);
+                               c4 = fio_uint_to_kmg(td->o.max_bs[DDIR_WRITE]);
 
                                log_info("%s: (g=%d): rw=%s, bs=%s-%s/%s-%s,"
                                         " ioengine=%s, iodepth=%u\n",