aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dynamic_debug.h
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2019-03-07 19:27:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-07 21:32:00 -0500
commit2bdde670beedf73de38b8607f0b1913358af7381 (patch)
tree2ed149d36bb031e518b661aa56b08c3833245ebd /include/linux/dynamic_debug.h
parenta9d4ab7a91165f325060d6441169ebeab08a2fec (diff)
dynamic_debug: consolidate DEFINE_DYNAMIC_DEBUG_METADATA definitions
Instead of defining DEFINE_DYNAMIC_DEBUG_METADATA in terms of a helper DEFINE_DYNAMIC_DEBUG_METADATA_KEY, that needs another helper dd_key_init to be properly defined, just make the various #ifdef branches define a _DPRINTK_KEY_INIT that can be used directly, similar to _DPRINTK_FLAGS_DEFAULT. Link: http://lkml.kernel.org/r/20190212214150.4807-5-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Jason Baron <jbaron@akamai.com> Cc: David Sterba <dsterba@suse.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Petr Mladek <pmladek@suse.com> Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/dynamic_debug.h')
-rw-r--r--include/linux/dynamic_debug.h22
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) \