docs: add warning to per_job_logs option
[fio.git] / backend.c
index b21c36640e4c5efb096a5633c849820e49444592..1fab467a1b06083d9428a68ee906d9e7e5b21500 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -49,6 +49,7 @@
 #include "helper_thread.h"
 #include "pshared.h"
 #include "zone-dist.h"
+#include "fio_time.h"
 
 static struct fio_sem *startup_sem;
 static struct flist_head *cgroup_list;
@@ -1133,6 +1134,9 @@ reap:
                if (ret < 0)
                        break;
 
+               if (ddir_rw(ddir) && td->o.thinkcycles)
+                       cycles_spin(td->o.thinkcycles);
+
                if (ddir_rw(ddir) && td->o.thinktime)
                        handle_thinktime(td, ddir, &comp_time);
 
@@ -1858,7 +1862,7 @@ static void *thread_main(void *data)
        if (rate_submit_init(td, sk_out))
                goto err;
 
-       set_epoch_time(td, o->log_unix_epoch | o->log_alternate_epoch, o->log_alternate_epoch_clock_id);
+       set_epoch_time(td, o->log_alternate_epoch_clock_id, o->job_start_clock_id);
        fio_getrusage(&td->ru_start);
        memcpy(&td->bw_sample_time, &td->epoch, sizeof(td->epoch));
        memcpy(&td->iops_sample_time, &td->epoch, sizeof(td->epoch));
@@ -2494,7 +2498,10 @@ reap:
                                                        strerror(ret));
                        } else {
                                pid_t pid;
+                               void *eo;
                                dprint(FD_PROCESS, "will fork\n");
+                               eo = td->eo;
+                               read_barrier();
                                pid = fork();
                                if (!pid) {
                                        int ret;
@@ -2503,6 +2510,7 @@ reap:
                                        _exit(ret);
                                } else if (__td_index == fio_debug_jobno)
                                        *fio_debug_jobp = pid;
+                               free(eo);
                                free(fd);
                                fd = NULL;
                        }