diff options
Diffstat (limited to 'include/linux/dynamic_debug.h')
| -rw-r--r-- | include/linux/dynamic_debug.h | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b3419da1a776..b17725400f75 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
| @@ -71,7 +71,7 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, | |||
| 71 | const struct net_device *dev, | 71 | const struct net_device *dev, |
| 72 | const char *fmt, ...); | 72 | const char *fmt, ...); |
| 73 | 73 | ||
| 74 | #define DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, key, init) \ | 74 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ |
| 75 | static struct _ddebug __aligned(8) \ | 75 | static struct _ddebug __aligned(8) \ |
| 76 | __attribute__((section("__verbose"))) name = { \ | 76 | __attribute__((section("__verbose"))) name = { \ |
| 77 | .modname = KBUILD_MODNAME, \ | 77 | .modname = KBUILD_MODNAME, \ |
| @@ -80,35 +80,27 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, | |||
| 80 | .format = (fmt), \ | 80 | .format = (fmt), \ |
| 81 | .lineno = __LINE__, \ | 81 | .lineno = __LINE__, \ |
| 82 | .flags = _DPRINTK_FLAGS_DEFAULT, \ | 82 | .flags = _DPRINTK_FLAGS_DEFAULT, \ |
| 83 | dd_key_init(key, init) \ | 83 | _DPRINTK_KEY_INIT \ |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | #ifdef CONFIG_JUMP_LABEL | 86 | #ifdef CONFIG_JUMP_LABEL |
| 87 | 87 | ||
| 88 | #define dd_key_init(key, init) key = (init) | ||
| 89 | |||
| 90 | #ifdef DEBUG | 88 | #ifdef DEBUG |
| 91 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ | 89 | |
| 92 | DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_true, \ | 90 | #define _DPRINTK_KEY_INIT .key.dd_key_true = (STATIC_KEY_TRUE_INIT) |
| 93 | (STATIC_KEY_TRUE_INIT)) | ||
| 94 | 91 | ||
| 95 | #define DYNAMIC_DEBUG_BRANCH(descriptor) \ | 92 | #define DYNAMIC_DEBUG_BRANCH(descriptor) \ |
| 96 | static_branch_likely(&descriptor.key.dd_key_true) | 93 | static_branch_likely(&descriptor.key.dd_key_true) |
| 97 | #else | 94 | #else |
| 98 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ | 95 | #define _DPRINTK_KEY_INIT .key.dd_key_false = (STATIC_KEY_FALSE_INIT) |
| 99 | DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, \ | ||
| 100 | (STATIC_KEY_FALSE_INIT)) | ||
| 101 | 96 | ||
| 102 | #define DYNAMIC_DEBUG_BRANCH(descriptor) \ | 97 | #define DYNAMIC_DEBUG_BRANCH(descriptor) \ |
| 103 | static_branch_unlikely(&descriptor.key.dd_key_false) | 98 | static_branch_unlikely(&descriptor.key.dd_key_false) |
| 104 | #endif | 99 | #endif |
| 105 | 100 | ||
| 106 | #else | 101 | #else /* !HAVE_JUMP_LABEL */ |
| 107 | |||
| 108 | #define dd_key_init(key, init) | ||
| 109 | 102 | ||
| 110 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ | 103 | #define _DPRINTK_KEY_INIT |
| 111 | DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, 0, 0) | ||
| 112 | 104 | ||
| 113 | #ifdef DEBUG | 105 | #ifdef DEBUG |
| 114 | #define DYNAMIC_DEBUG_BRANCH(descriptor) \ | 106 | #define DYNAMIC_DEBUG_BRANCH(descriptor) \ |
