Add --debug=parse for option parsing debug

Adds log.h and debug.h to split the logging and debug bits out of
fio, so that the parser can use them.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c
index 90874f1..3c20312 100644
--- a/parse.c
+++ b/parse.c
@@ -10,6 +10,7 @@
 #include <limits.h>
 
 #include "parse.h"
+#include "debug.h"
 
 static int vp_cmp(const void *p1, const void *p2)
 {
@@ -229,6 +230,9 @@
 	char **cp;
 	int ret = 0, is_time = 0;
 
+	dprint(FD_PARSE, "__handle_option=%s, type=%d, ptr=%s\n", o->name,
+							o->type, ptr);
+
 	if (!ptr && o->type != FIO_OPT_STR_SET) {
 		fprintf(stderr, "Option %s requires an argument\n", o->name);
 		return 1;
@@ -414,6 +418,8 @@
 	const char *ptr2 = NULL;
 	int r1, r2;
 
+	dprint(FD_PARSE, "handle_option=%s, ptr=%s\n", o->name, ptr);
+
 	/*
 	 * See if we have a second set of parameters, hidden after a comma.
 	 * Do this before parsing the first round, to check if we should
@@ -661,6 +667,8 @@
 {
 	struct fio_option *o;
 
+	dprint(FD_PARSE, "filling default options\n");
+
 	for (o = &options[0]; o->name; o++)
 		if (o->def)
 			handle_option(o, o->def, data);
@@ -674,6 +682,8 @@
 {
 	struct fio_option *o;
 
+	dprint(FD_PARSE, "init options\n");
+
 	for (o = &options[0]; o->name; o++) {
 		if (o->type == FIO_OPT_BOOL) {
 			o->minval = 0;