diff options
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 { | |||
| 17 | const char *format; | 17 | const char *format; |
| 18 | unsigned int lineno:18; | 18 | unsigned int lineno:18; |
| 19 | /* | 19 | /* |
| 20 | * The flags field controls the behaviour at the callsite. | 20 | * The flags field controls the behaviour at the callsite. |
| 21 | * The bits here are changed dynamically when the user | 21 | * The bits here are changed dynamically when the user |
| 22 | * writes commands to <debugfs>/dynamic_debug/control | 22 | * writes commands to <debugfs>/dynamic_debug/control |
| 23 | */ | 23 | */ |
| 24 | #define _DPRINTK_FLAGS_NONE 0 | 24 | #define _DPRINTK_FLAGS_NONE 0 |
| @@ -44,6 +44,9 @@ extern int ddebug_remove_module(const char *mod_name); | |||
| 44 | extern __printf(2, 3) | 44 | extern __printf(2, 3) |
| 45 | int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); | 45 | int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); |
| 46 | 46 | ||
| 47 | extern int ddebug_dyndbg_module_param_cb(char *param, char *val, | ||
| 48 | const char *modname); | ||
| 49 | |||
| 47 | struct device; | 50 | struct device; |
| 48 | 51 | ||
| 49 | extern __printf(3, 4) | 52 | extern __printf(3, 4) |
| @@ -94,11 +97,26 @@ do { \ | |||
| 94 | 97 | ||
| 95 | #else | 98 | #else |
| 96 | 99 | ||
| 100 | #include <linux/string.h> | ||
| 101 | #include <linux/errno.h> | ||
| 102 | |||
| 97 | static inline int ddebug_remove_module(const char *mod) | 103 | static inline int ddebug_remove_module(const char *mod) |
| 98 | { | 104 | { |
| 99 | return 0; | 105 | return 0; |
| 100 | } | 106 | } |
| 101 | 107 | ||
| 108 | static inline int ddebug_dyndbg_module_param_cb(char *param, char *val, | ||
| 109 | const char *modname) | ||
| 110 | { | ||
| 111 | if (strstr(param, "dyndbg")) { | ||
| 112 | /* avoid pr_warn(), which wants pr_fmt() fully defined */ | ||
| 113 | printk(KERN_WARNING "dyndbg param is supported only in " | ||
| 114 | "CONFIG_DYNAMIC_DEBUG builds\n"); | ||
| 115 | return 0; /* allow and ignore */ | ||
| 116 | } | ||
| 117 | return -EINVAL; | ||
| 118 | } | ||
| 119 | |||
| 102 | #define dynamic_pr_debug(fmt, ...) \ | 120 | #define dynamic_pr_debug(fmt, ...) \ |
| 103 | do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) | 121 | do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0) |
| 104 | #define dynamic_dev_dbg(dev, fmt, ...) \ | 122 | #define dynamic_dev_dbg(dev, fmt, ...) \ |
