diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-07-24 22:43:04 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-07-24 22:43:04 -0700 |
| commit | 314820c9e892d8f41ba4db300ec96770d9c8294b (patch) | |
| tree | 3d5c59a429239b180c77e57f998a78d3f2b79827 /include/linux/dynamic_debug.h | |
| parent | e76b8ee25e034ab601b525abb95cea14aa167ed3 (diff) | |
| parent | 07b8481d4aff73d6f451f25e74ea10240ff5131e (diff) | |
Merge branch 'next' into for-linus
Diffstat (limited to 'include/linux/dynamic_debug.h')
| -rw-r--r-- | include/linux/dynamic_debug.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 7e3c53a900d8..c18257b0fa72 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -17,8 +17,8 @@ struct _ddebug { const char *format; unsigned int lineno:18; /* - * The flags field controls the behaviour at the callsite. - * The bits here are changed dynamically when the user + * 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_NONE 0 @@ -44,6 +44,9 @@ extern int ddebug_remove_module(const char *mod_name); extern __printf(2, 3) int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); +extern int ddebug_dyndbg_module_param_cb(char *param, char *val, + const char *modname); + struct device; extern __printf(3, 4) @@ -94,11 +97,26 @@ do { \ #else +#include <linux/string.h> +#include <linux/errno.h> + static inline int ddebug_remove_module(const char *mod) { return 0; } +static inline int ddebug_dyndbg_module_param_cb(char *param, char *val, + const char *modname) +{ + if (strstr(param, "dyndbg")) { + /* avoid pr_warn(), which wants pr_fmt() fully defined */ + printk(KERN_WARNING "dyndbg param is supported only in " + "CONFIG_DYNAMIC_DEBUG builds\n"); + return 0; /* allow and ignore */ + } + return -EINVAL; +} + #define dynamic_pr_debug(fmt, ...) \ do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) #define dynamic_dev_dbg(dev, fmt, ...) \ |
