diff options
Diffstat (limited to 'include/linux/dynamic_debug.h')
| -rw-r--r-- | include/linux/dynamic_debug.h | 19 | 
1 files changed, 11 insertions, 8 deletions
| diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 0564e3c39882..7e3c53a900d8 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -15,20 +15,24 @@ struct _ddebug {  	const char *function;  	const char *filename;  	const char *format; -	unsigned int lineno:24; +	unsigned int lineno:18;  	/*   	 * The flags field controls the behaviour at the callsite.   	 * The bits here are changed dynamically when the user  	 * writes commands to <debugfs>/dynamic_debug/control  	 */ -#define _DPRINTK_FLAGS_PRINT   (1<<0)  /* printk() a message using the format */ +#define _DPRINTK_FLAGS_NONE	0 +#define _DPRINTK_FLAGS_PRINT	(1<<0) /* printk() a message using the format */  #define _DPRINTK_FLAGS_INCL_MODNAME	(1<<1)  #define _DPRINTK_FLAGS_INCL_FUNCNAME	(1<<2)  #define _DPRINTK_FLAGS_INCL_LINENO	(1<<3)  #define _DPRINTK_FLAGS_INCL_TID		(1<<4) +#if defined DEBUG +#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT +#else  #define _DPRINTK_FLAGS_DEFAULT 0 +#endif  	unsigned int flags:8; -	char enabled;  } __attribute__((aligned(8))); @@ -62,21 +66,20 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,  		.format = (fmt),				\  		.lineno = __LINE__,				\  		.flags =  _DPRINTK_FLAGS_DEFAULT,		\ -		.enabled = false,				\  	}  #define dynamic_pr_debug(fmt, ...)				\  do {								\  	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);		\ -	if (unlikely(descriptor.enabled))			\ +	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT))	\  		__dynamic_pr_debug(&descriptor, pr_fmt(fmt),	\  				   ##__VA_ARGS__);		\  } while (0)  #define dynamic_dev_dbg(dev, fmt, ...)				\  do {								\ -	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);	\ -	if (unlikely(descriptor.enabled))			\ +	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);		\ +	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT))	\  		__dynamic_dev_dbg(&descriptor, dev, fmt,	\  				  ##__VA_ARGS__);		\  } while (0) @@ -84,7 +87,7 @@ do {								\  #define dynamic_netdev_dbg(dev, fmt, ...)			\  do {								\  	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);		\ -	if (unlikely(descriptor.enabled))			\ +	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT))	\  		__dynamic_netdev_dbg(&descriptor, dev, fmt,	\  				     ##__VA_ARGS__);		\  } while (0) |