Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1422822 > unrolled thread

[PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG

Started by"Jason A. Donenfeld" <Jason@zx2c4.com>
First post2016-06-15 11:30 +0200
Last post2016-06-16 10:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-06-15 11:30 +0200
    Re: [PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for  CONFIG_DYNAMIC_DEBUG David Miller <davem@davemloft.net> - 2016-06-16 07:10 +0200
      Re: [PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-06-16 10:40 +0200

#1422822 — [PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG

From"Jason A. Donenfeld" <Jason@zx2c4.com>
Date2016-06-15 11:30 +0200
Subject[PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG
Message-ID<rKfj3-Ig-17@gated-at.bofh.it>
The implementation of net_dbg_ratelimited in the CONFIG_DYNAMIC_DEBUG
case was added with 2c94b5373 ("net: Implement net_dbg_ratelimited() for
CONFIG_DYNAMIC_DEBUG case"). The implementation strategy was to take the
usual definition of the dynamic_pr_debug macro, but alter it by adding a
call to "net_ratelimit()" in the if statement. This is, in fact, the
correct approach.

However, while doing this, the author of the commit forgot to surround
fmt by pr_fmt, resulting in unprefixed log messages appearing in the
console. So, this commit adds back the pr_fmt(fmt) invocation, making
net_dbg_ratelimited properly consistent across DEBUG, no DEBUG, and
DYNAMIC_DEBUG cases, and bringing parity with the behavior of
dynamic_pr_debug as well.

Fixes: 2c94b5373 ("net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Tim Bingham <tbingham@akamai.com>
---
 include/linux/net.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/net.h b/include/linux/net.h
index 9aa49a0..25aa03b 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -251,7 +251,8 @@ do {									\
 	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
 	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) &&	\
 	    net_ratelimit())						\
-		__dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__);	\
+		__dynamic_pr_debug(&descriptor, pr_fmt(fmt),		\
+		                   ##__VA_ARGS__);			\
 } while (0)
 #elif defined(DEBUG)
 #define net_dbg_ratelimited(fmt, ...)				\
-- 
2.8.4

[toc] | [next] | [standalone]


#1423680 — Re: [PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG

FromDavid Miller <davem@davemloft.net>
Date2016-06-16 07:10 +0200
SubjectRe: [PATCH] net: Don't forget pr_fmt on net_dbg_ratelimited for CONFIG_DYNAMIC_DEBUG
Message-ID<rKxIZ-46r-7@gated-at.bofh.it>
In reply to#1422822
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Wed, 15 Jun 2016 11:14:53 +0200

> The implementation of net_dbg_ratelimited in the CONFIG_DYNAMIC_DEBUG
> case was added with 2c94b5373 ("net: Implement net_dbg_ratelimited() for
> CONFIG_DYNAMIC_DEBUG case"). The implementation strategy was to take the
> usual definition of the dynamic_pr_debug macro, but alter it by adding a
> call to "net_ratelimit()" in the if statement. This is, in fact, the
> correct approach.
> 
> However, while doing this, the author of the commit forgot to surround
> fmt by pr_fmt, resulting in unprefixed log messages appearing in the
> console. So, this commit adds back the pr_fmt(fmt) invocation, making
> net_dbg_ratelimited properly consistent across DEBUG, no DEBUG, and
> DYNAMIC_DEBUG cases, and bringing parity with the behavior of
> dynamic_pr_debug as well.
> 
> Fixes: 2c94b5373 ("net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case")
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Cc: Tim Bingham <tbingham@akamai.com>

Looks good, applied, thanks.

[toc] | [prev] | [next] | [standalone]


#1423792

From"Jason A. Donenfeld" <Jason@zx2c4.com>
Date2016-06-16 10:40 +0200
Message-ID<rKB0d-5XD-11@gated-at.bofh.it>
In reply to#1423680
On Thu, Jun 16, 2016 at 7:08 AM, David Miller <davem@davemloft.net> wrote:
> Looks good, applied, thanks.

Great. Probably not a show stopper, but it would be nice to see this in stable.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web