]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Add basic development debugging framework.
authorKris Van Hees <kris.van.hees@oracle.com>
Wed, 23 Jan 2013 09:42:32 +0000 (04:42 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Wed, 23 Jan 2013 09:42:32 +0000 (04:42 -0500)
This patch adds some defines that can be used to provide debugging output in
support of development.  This is debugging output that is controlled at build
time rather than runtime.  For production builds, this will always be disabled.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
dtrace/dtrace.h
dtrace/dtrace_debug.h [new file with mode: 0644]

index b9cb4f296053e018554f70bfd667db3b92d1a6b8..2c4ee746904ccb56b611462b4627d398b802bbc6 100644 (file)
@@ -16,6 +16,8 @@
 #include <asm/ptrace.h>
 #include <asm/sections.h>
 
+#include "dtrace_debug.h"
+
 #define UINT8_MAX              (0xff)
 #define UINT8_MIN              0
 #define UINT16_MAX             (0xffff)
diff --git a/dtrace/dtrace_debug.h b/dtrace/dtrace_debug.h
new file mode 100644 (file)
index 0000000..9040494
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef _DTRACE_DEBUG_H_
+#define _DTRACE_DEBUG_H_
+
+#ifdef CONFIG_DT_DEBUG
+
+# undef DT_DBG_AGG
+# undef DT_DBG_BUF
+# define DT_DBG_DOF
+# define DT_DBG_IOCTL
+# undef DT_DBG_PROBE
+
+#else /* CONFIG_DT_DEBUG */
+
+# undef DT_DBG_AGG
+# undef DT_DBG_BUF
+# undef DT_DBG_DOF
+# undef DT_DBG_IOCTL
+# undef DT_DBG_PROBE
+
+#endif /* CONFIG_DT_DEBUG */
+
+/*
+ * Here are the actual actions for the various debug cases.
+ */
+#ifdef DT_DBG_AGG
+# define dt_dbg_agg(fmt, ...)  pr_info(fmt, ## __VA_ARGS__)
+#else
+# define dt_dbg_agg(fmt, ...)
+#endif
+
+#ifdef DT_DBG_BUF
+# define dt_dbg_buf(fmt, ...)  pr_info(fmt, ## __VA_ARGS__)
+#else
+# define dt_dbg_buf(fmt, ...)
+#endif
+
+#ifdef DT_DBG_DOF
+# define dt_dbg_dof(fmt, ...)  pr_info(fmt, ## __VA_ARGS__)
+#else
+# define dt_dbg_dof(fmt, ...)
+#endif
+
+#ifdef DT_DBG_IOCTL
+# define dt_dbg_ioctl(fmt, ...)        pr_info(fmt, ## __VA_ARGS__)
+#else
+# define dt_dbg_ioctl(fmt, ...)
+#endif
+
+#ifdef DT_DBG_PROBE
+# define dt_dbg_probe(fmt, ...)        pr_info(fmt, ## __VA_ARGS__)
+#else
+# define dt_dbg_probe(fmt, ...)
+#endif
+
+#endif /* _DTRACE_DEBUG_H_ */