* [PATCH v6 2/8] linux/net.h: use unique identifier for each struct _ddebug
[not found] <20190617222034.10799-1-linux@rasmusvillemoes.dk>
@ 2019-06-17 22:20 ` Rasmus Villemoes
2019-06-17 23:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Rasmus Villemoes @ 2019-06-17 22:20 UTC (permalink / raw)
To: Ingo Molnar, Andrew Morton
Cc: Jason Baron, Nathan Chancellor, Nick Desaulniers, linux-kernel,
Rasmus Villemoes, netdev
Changes on x86-64 later in this series require that all struct _ddebug
descriptors in a translation unit uses distinct identifiers. Realize
that for net_dbg_ratelimited by generating such an identifier via
__UNIQUE_ID and pass that to an extra level of macros.
No functional change.
Cc: netdev@vger.kernel.org
Acked-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/linux/net.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/net.h b/include/linux/net.h
index f7d672cf25b5..a080ede95b47 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -264,7 +264,7 @@ do { \
#define net_info_ratelimited(fmt, ...) \
net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__)
#if defined(CONFIG_DYNAMIC_DEBUG)
-#define net_dbg_ratelimited(fmt, ...) \
+#define _net_dbg_ratelimited(descriptor, fmt, ...) \
do { \
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
if (DYNAMIC_DEBUG_BRANCH(descriptor) && \
@@ -272,6 +272,8 @@ do { \
__dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
##__VA_ARGS__); \
} while (0)
+#define net_dbg_ratelimited(fmt, ...) \
+ _net_dbg_ratelimited(__UNIQUE_ID(ddebug), fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define net_dbg_ratelimited(fmt, ...) \
net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v6 2/8] linux/net.h: use unique identifier for each struct _ddebug
2019-06-17 22:20 ` [PATCH v6 2/8] linux/net.h: use unique identifier for each struct _ddebug Rasmus Villemoes
@ 2019-06-17 23:08 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-17 23:08 UTC (permalink / raw)
To: linux
Cc: mingo, akpm, jbaron, natechancellor, ndesaulniers, linux-kernel, netdev
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: Tue, 18 Jun 2019 00:20:28 +0200
> Changes on x86-64 later in this series require that all struct _ddebug
> descriptors in a translation unit uses distinct identifiers. Realize
> that for net_dbg_ratelimited by generating such an identifier via
> __UNIQUE_ID and pass that to an extra level of macros.
>
> No functional change.
>
> Cc: netdev@vger.kernel.org
> Acked-by: Jason Baron <jbaron@akamai.com>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-17 23:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190617222034.10799-1-linux@rasmusvillemoes.dk>
2019-06-17 22:20 ` [PATCH v6 2/8] linux/net.h: use unique identifier for each struct _ddebug Rasmus Villemoes
2019-06-17 23:08 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).