summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/linux/net.h')
-rw-r--r--kernel/include/linux/net.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/include/linux/net.h b/kernel/include/linux/net.h
index 0b4ac7da5..c00b8d182 100644
--- a/kernel/include/linux/net.h
+++ b/kernel/include/linux/net.h
@@ -245,7 +245,16 @@ do { \
net_ratelimited_function(pr_warn, fmt, ##__VA_ARGS__)
#define net_info_ratelimited(fmt, ...) \
net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__)
-#if defined(DEBUG)
+#if defined(CONFIG_DYNAMIC_DEBUG)
+#define net_dbg_ratelimited(fmt, ...) \
+do { \
+ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
+ if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \
+ net_ratelimit()) \
+ __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
+ ##__VA_ARGS__); \
+} while (0)
+#elif defined(DEBUG)
#define net_dbg_ratelimited(fmt, ...) \
net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
#else