Add support for runtime log compression

If log_compression=64M is specified, fio will "bite" off chunks of
the IO logs and runtime compress them with zlib. This can greatly
reduce the amount of memory required to do iops/bw/lat logging of
a run, at the cost of using some background CPU for the compression.

Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/tp.h b/tp.h
new file mode 100644
index 0000000..b1aa1e2
--- /dev/null
+++ b/tp.h
@@ -0,0 +1,32 @@
+#ifndef FIO_TP_H
+#define FIO_TP_H
+
+#include "flist.h"
+
+struct tp_work;
+typedef int (tp_work_fn)(struct tp_work *);
+
+struct tp_work {
+	struct flist_head list;
+	tp_work_fn *fn;
+	int wait;
+	pthread_cond_t cv;
+	pthread_mutex_t lock;
+	volatile int done;
+};
+
+struct tp_data {
+	pthread_t thread;
+	pthread_cond_t cv;
+	pthread_mutex_t lock;
+	struct flist_head work;
+	volatile int thread_exit;
+	pthread_cond_t sleep_cv;
+	volatile int sleeping;
+};
+
+extern void tp_init(struct tp_data **);
+extern void tp_exit(struct tp_data **);
+extern void tp_queue_work(struct tp_data *, struct tp_work *);
+
+#endif