Add blktrace and verify debug tracing
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index b21ec18d787821dbefb4c2b9987b1de9bf236c93..c86e4629afef3116dd32cabf123a6d4bf3e94837 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -973,18 +973,29 @@ static inline void clear_error(struct thread_data *td)
 }
 
 enum {
-       FD_PROCESS      = 1 << 0,
-       FD_FILE         = 1 << 1,
-       FD_IO           = 1 << 2,
-       FD_MEM          = 1 << 3,
+       FD_PROCESS      = 0,
+       FD_FILE,
+       FD_IO,
+       FD_MEM,
+       FD_BLKTRACE,
+       FD_VERIFY,
+       FD_DEBUG_MAX,
 };
 
+struct debug_level {
+       const char *name;
+       unsigned long shift;
+};
+extern struct debug_level debug_levels[];
+
 extern unsigned long fio_debug;
-#define dprint(type, str, args...)             \
-       do {                                    \
-               if (((type) & fio_debug) == 0)  \
-                       break;                  \
-               log_info(str, ##args);          \
+#define dprint(type, str, args...)                             \
+       do {                                                    \
+               assert(type < FD_DEBUG_MAX);                    \
+               if ((((1 << type)) & fio_debug) == 0)           \
+                       break;                                  \
+               log_info("%-8s ", debug_levels[(type)].name);   \
+               log_info(str, ##args);                          \
        } while (0)
 
 static inline void dprint_io_u(struct io_u *io_u, const char *p)