From: Kris Van Hees Date: Wed, 23 Jan 2013 09:42:32 +0000 (-0500) Subject: Add basic development debugging framework. X-Git-Tag: v4.1.12-111.0.20170907_2225~3^2~3^2~168 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7c4cdf629b4d12ffc7ff25cb00bddc23c53d163a;p=users%2Fjedix%2Flinux-maple.git Add basic development debugging framework. 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 --- diff --git a/dtrace/dtrace.h b/dtrace/dtrace.h index b9cb4f296053e..2c4ee746904cc 100644 --- a/dtrace/dtrace.h +++ b/dtrace/dtrace.h @@ -16,6 +16,8 @@ #include #include +#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 index 0000000000000..9040494e1cd2f --- /dev/null +++ b/dtrace/dtrace_debug.h @@ -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_ */