Fio 1.99.8
[fio.git] / options.c
index dacfb73808f48c9868c2ba5a41937935454181c2..4207537e9c4a4bf4958213b6dd3cf6783582b766 100644 (file)
--- a/options.c
+++ b/options.c
@@ -777,6 +777,7 @@ static int str_gtod_reduce_cb(void *data, int *il)
        td->o.disable_clat = !!val;
        td->o.disable_slat = !!val;
        td->o.disable_bw = !!val;
+       td->o.clat_percentiles = !val;
        if (val)
                td->tv_cache_mask = 63;
 
@@ -2346,7 +2347,10 @@ int fio_show_option_help(const char *opt)
        return show_cmd_help(options, opt);
 }
 
-static void __options_mem(struct thread_data *td, int alloc)
+/*
+ * dupe FIO_OPT_STR_STORE options
+ */
+void options_mem_dupe(struct thread_data *td)
 {
        struct thread_options *o = &td->o;
        struct fio_option *opt;
@@ -2358,32 +2362,13 @@ static void __options_mem(struct thread_data *td, int alloc)
                        continue;
 
                ptr = (void *) o + opt->off1;
-               if (*ptr) {
-                       if (alloc)
-                               *ptr = strdup(*ptr);
-                       else {
-                               free(*ptr);
-                               *ptr = NULL;
-                       }
-               }
+               if (!*ptr)
+                       ptr = td_var(o, opt->off1);
+               if (*ptr)
+                       *ptr = strdup(*ptr);
        }
 }
 
-/*
- * dupe FIO_OPT_STR_STORE options
- */
-void options_mem_dupe(struct thread_data *td)
-{
-       __options_mem(td, 1);
-}
-
-void options_mem_free(struct thread_data fio_unused *td)
-{
-#if 0
-       __options_mem(td, 0);
-#endif
-}
-
 unsigned int fio_get_kb_base(void *data)
 {
        struct thread_data *td = data;
@@ -2464,3 +2449,8 @@ void del_opt_posval(const char *optname, const char *ival)
                o->posval[i].help = NULL;
        }
 }
+
+void fio_options_free(struct thread_data *td)
+{
+       options_free(options, td);
+}