sfree(NULL) is ok
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 778749d6a3322411a7affc06f945ee2c3a4a2aff..ae62d23329839c1c9bc28c5f57a6a826cb42c6f1 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -40,6 +40,8 @@
 #include "verify.h"
 #include "diskutil.h"
 #include "cgroup.h"
+#include "profile.h"
+#include "lib/rand.h"
 
 unsigned long page_mask;
 unsigned long page_size;
@@ -432,6 +434,8 @@ static void do_verify(struct thread_data *td)
        int ret, min_events;
        unsigned int i;
 
+       dprint(FD_VERIFY, "starting loop\n");
+
        /*
         * sync io first and invalidate cache, to make sure we really
         * read from disk.
@@ -569,6 +573,8 @@ sync_done:
                cleanup_pending_aio(td);
 
        td_set_runstate(td, TD_RUNNING);
+
+       dprint(FD_VERIFY, "exiting loop\n");
 }
 
 /*
@@ -1631,6 +1637,7 @@ int main(int argc, char *argv[])
        long ps;
 
        sinit();
+       init_rand(&__fio_rand_state);
 
        /*
         * We need locale for number printing, if it isn't set then just
@@ -1653,6 +1660,9 @@ int main(int argc, char *argv[])
        if (parse_options(argc, argv))
                return 1;
 
+       if (exec_profile && load_profile(exec_profile))
+               return 1;
+
        if (!thread_number)
                return 0;
 
@@ -1684,8 +1694,7 @@ int main(int argc, char *argv[])
 
        cgroup_kill(cgroup_list);
        sfree(cgroup_list);
-       if (cgroup_mnt)
-               sfree(cgroup_mnt);
+       sfree(cgroup_mnt);
 
        fio_mutex_remove(startup_mutex);
        fio_mutex_remove(writeout_mutex);