[PATCH] Split status/eta code out of fio.c
All in the name of making the code base easier to go through.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index c778206..9471666 100644
--- a/fio.h
+++ b/fio.h
@@ -427,10 +427,12 @@
/*
* Time functions
*/
+extern void time_init(void);
extern unsigned long utime_since(struct timeval *, struct timeval *);
extern unsigned long mtime_since(struct timeval *, struct timeval *);
extern unsigned long mtime_since_now(struct timeval *);
extern unsigned long time_since_now(struct timeval *);
+extern unsigned long mtime_since_genesis(void);
extern void __usec_sleep(unsigned int);
extern void usec_sleep(struct thread_data *, unsigned long);
extern void rate_throttle(struct thread_data *, unsigned long, unsigned int);
@@ -448,6 +450,29 @@
extern int setup_files(struct thread_data *);
/*
+ * ETA/status stuff
+ */
+extern void print_thread_status(void);
+extern void print_status_init(int);
+
+/*
+ * Thread life cycle. Once a thread has a runstate beyond TD_INITIALIZED, it
+ * will never back again. It may cycle between running/verififying/fsyncing.
+ * Once the thread reaches TD_EXITED, it is just waiting for the core to
+ * reap it.
+ */
+enum {
+ TD_NOT_CREATED = 0,
+ TD_CREATED,
+ TD_INITIALIZED,
+ TD_RUNNING,
+ TD_VERIFYING,
+ TD_FSYNCING,
+ TD_EXITED,
+ TD_REAPED,
+};
+
+/*
* This is a pretty crappy semaphore implementation, but with the use that fio
* has (just signalling start/go conditions), it doesn't have to be better.
* Naturally this would not work for any type of contended semaphore or