Set verify_interval to minimum blocksize if not given
[fio.git] / init.c
diff --git a/init.c b/init.c
index acebb7d10b8abb9add6aad77a58cce211538107e..e7245ade0313ef92fa659e60250223b729448986 100644 (file)
--- a/init.c
+++ b/init.c
@@ -168,6 +168,8 @@ static struct thread_data *get_new_job(int global, struct thread_data *parent)
        dup_files(td, parent);
        options_mem_dupe(td);
 
+       profile_add_hooks(td);
+
        td->thread_number = thread_number;
        return td;
 }
@@ -176,6 +178,8 @@ static void put_job(struct thread_data *td)
 {
        if (td == &def_thread)
                return;
+       
+       profile_td_exit(td);
 
        if (td->error)
                log_info("fio: %s\n", td->verror);
@@ -354,8 +358,12 @@ static int fixup_options(struct thread_data *td)
                log_info("fio: mixed read/write workload with verify. May not "
                 "work as expected, unless you pre-populated the file\n");
 
-       if (td->o.verify != VERIFY_NONE)
+       if (td->o.verify != VERIFY_NONE) {
                td->o.refill_buffers = 1;
+               if (o->max_bs[DDIR_WRITE] != o->min_bs[DDIR_WRITE] &&
+                   !o->verify_interval)
+                       o->verify_interval = o->min_bs[DDIR_WRITE];
+       }
 
        if (td->o.pre_read) {
                td->o.invalidate_cache = 0;
@@ -500,6 +508,9 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
                return 0;
        }
 
+       if (profile_td_init(td))
+               return 1;
+
        engine = get_engine_name(td->o.ioengine);
        td->io_ops = load_ioengine(td, engine);
        if (!td->io_ops) {