Merge branch 'master' into client-server
[fio.git] / init.c
diff --git a/init.c b/init.c
index 2341915831d22eff07b88a468283aa24fe029cc2..142a1637b43bd108a1d34e16a3ac6349a2dfbc54 100644 (file)
--- a/init.c
+++ b/init.c
@@ -37,6 +37,7 @@ static char fio_version_string[] =    __fio_stringify(FIO_MAJOR) "."  \
 static char **ini_file;
 static int max_jobs = FIO_MAX_JOBS;
 static int dump_cmdline;
+static int def_timeout;
 
 static struct thread_data def_thread;
 struct thread_data *threads = NULL;
@@ -69,6 +70,24 @@ unsigned int *fio_debug_jobp = NULL;
 
 static char cmd_optstr[256];
 
+const fio_fp64_t def_percentile_list[FIO_IO_U_LIST_MAX_LEN] = {
+       { .u.f  =  1.0 },
+       { .u.f  =  5.0 },
+       { .u.f  = 10.0 },
+       { .u.f  = 20.0 },
+       { .u.f  = 30.0 },
+       { .u.f  = 40.0 },
+       { .u.f  = 50.0 },
+       { .u.f  = 60.0 },
+       { .u.f  = 70.0 },
+       { .u.f  = 80.0 },
+       { .u.f  = 90.0 },
+       { .u.f  = 95.0 },
+       { .u.f  = 99.0 },
+       { .u.f  = 99.5 },
+       { .u.f  = 99.9 },
+};
+
 /*
  * Command line options. These will contain the above, plus a few
  * extra that only pertain to fio itself and not jobs.
@@ -718,9 +737,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
 
        td->ts.clat_percentiles = td->o.clat_percentiles;
        if (td->o.overwrite_plist)
-               td->ts.percentile_list = td->o.percentile_list;
+               memcpy(td->ts.percentile_list, td->o.percentile_list, sizeof(td->o.percentile_list));
        else
-               td->ts.percentile_list = NULL;
+               memcpy(td->ts.percentile_list, def_percentile_list, sizeof(def_percentile_list));
 
        td->ts.clat_stat[0].min_val = td->ts.clat_stat[1].min_val = ULONG_MAX;
        td->ts.slat_stat[0].min_val = td->ts.slat_stat[1].min_val = ULONG_MAX;
@@ -1065,6 +1084,7 @@ static int fill_def_thread(void)
        memset(&def_thread, 0, sizeof(def_thread));
 
        fio_getaffinity(getpid(), &def_thread.o.cpumask);
+       def_thread.o.timeout = def_timeout;
 
        /*
         * fill default options
@@ -1222,7 +1242,7 @@ int parse_cmd_line(int argc, char *argv[])
                        break;
                case 't':
                        fio_client_add_cmd_option(cur_client, argv[optind-1]);
-                       def_thread.o.timeout = atoi(optarg);
+                       def_timeout = atoi(optarg);
                        break;
                case 'l':
                        fio_client_add_cmd_option(cur_client, argv[optind-1]);