[PATCH] Make it easier to match up filename and job number
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 66b70ef8c52266e405bd6d1e14459d10e442cc39..49603ebc70f1cbbda6db2cf7ee15c39c93c97f14 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <unistd.h>
 
 #include "list.h"
 #include "md5.h"
@@ -152,7 +153,6 @@ struct thread_data {
        size_t orig_buffer_size;
        volatile int terminate;
        volatile int runstate;
-       volatile int old_runstate;
        enum fio_ddir ddir;
        unsigned int iomix;
        unsigned int ioprio;
@@ -191,7 +191,6 @@ struct thread_data {
        unsigned int numjobs;
        unsigned int iodepth;
        os_cpu_mask_t cpumask;
-       unsigned int jobnum;
        unsigned int iolog;
        unsigned int read_iolog;
        unsigned int write_iolog;
@@ -324,6 +323,8 @@ extern int exitall_on_terminate;
 extern int thread_number;
 extern int shm_id;
 extern int groupid;
+extern FILE *f_out;
+extern FILE *f_err;
 
 extern struct thread_data *threads;
 
@@ -439,4 +440,13 @@ static inline void fio_sem_up(volatile int volatile *sem)
        (*sem)++;
 }
 
+/*
+ * If logging output to a file, stderr should go to both stderr and f_err
+ */
+#define log_err(args...)       do {            \
+       fprintf(f_err, ##args);                 \
+       if (f_err != stderr)                    \
+               fprintf(stderr, ##args);        \
+       } while (0)
+
 #endif