iolog: note type of log
[fio.git] / init.c
diff --git a/init.c b/init.c
index 0da878d52ff135ebe20efe3081742dc674e14252..90521e5f36dbce8c53eeb37b74840f39ad42864a 100644 (file)
--- a/init.c
+++ b/init.c
@@ -26,6 +26,7 @@
 #include "idletime.h"
 
 #include "lib/getopt.h"
+#include "lib/strcasestr.h"
 
 const char fio_version_string[] = FIO_VERSION;
 
@@ -44,7 +45,6 @@ int exitall_on_terminate = 0;
 int output_format = FIO_OUTPUT_NORMAL;
 int eta_print = FIO_ETA_AUTO;
 int eta_new_line = 0;
-unsigned long long mlock_size = 0;
 FILE *f_out = NULL;
 FILE *f_err = NULL;
 char **job_sections = NULL;
@@ -559,6 +559,13 @@ static int fixup_options(struct thread_data *td)
                }
        }
 
+       if (!o->unit_base) {
+               if (td->io_ops->flags & FIO_BIT_BASED)
+                       o->unit_base = 1;
+               else
+                       o->unit_base = 8;
+       }
+
 #ifndef CONFIG_FDATASYNC
        if (o->fdatasync_blocks) {
                log_info("fio: this platform does not support fdatasync()"
@@ -838,7 +845,7 @@ static char *make_filename(char *buf, struct thread_options *o,
                        size_t pre_len, post_start = 0;
                        char *str, *dst = copy;
 
-                       str = strstr(buf, f->keyword);
+                       str = strcasestr(buf, f->keyword);
                        if (!str)
                                break;
 
@@ -912,11 +919,6 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
        if (ioengine_load(td))
                goto err;
 
-       if (o->use_thread)
-               nr_thread++;
-       else
-               nr_process++;
-
        if (o->odirect)
                td->io_ops->flags |= FIO_RAWIO;
 
@@ -982,14 +984,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
                goto err;
 
        if (o->write_lat_log) {
-               setup_log(&td->lat_log, o->log_avg_msec);
-               setup_log(&td->slat_log, o->log_avg_msec);
-               setup_log(&td->clat_log, o->log_avg_msec);
+               setup_log(&td->lat_log, o->log_avg_msec, IO_LOG_TYPE_LAT);
+               setup_log(&td->slat_log, o->log_avg_msec, IO_LOG_TYPE_LAT);
+               setup_log(&td->clat_log, o->log_avg_msec, IO_LOG_TYPE_LAT);
        }
        if (o->write_bw_log)
-               setup_log(&td->bw_log, o->log_avg_msec);
+               setup_log(&td->bw_log, o->log_avg_msec, IO_LOG_TYPE_BW);
        if (o->write_iops_log)
-               setup_log(&td->iops_log, o->log_avg_msec);
+               setup_log(&td->iops_log, o->log_avg_msec, IO_LOG_TYPE_IOPS);
 
        if (!o->name)
                o->name = strdup(jobname);