Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1401975
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.5 024/101] net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case |
| Date | 2016-05-17 03:50 +0200 |
| Message-ID | <rzCj2-6q8-71@gated-at.bofh.it> (permalink) |
| References | <rzBZD-6iF-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Bingham <tbingham@akamai.com>
[ Upstream commit 2c94b53738549d81dc7464a32117d1f5112c64d3 ]
Prior to commit d92cff89a0c8 ("net_dbg_ratelimited: turn into no-op
when !DEBUG") the implementation of net_dbg_ratelimited() was buggy
for both the DEBUG and CONFIG_DYNAMIC_DEBUG cases.
The bug was that net_ratelimit() was being called and, despite
returning true, nothing was being printed to the console. This
resulted in messages like the following -
"net_ratelimit: %d callbacks suppressed"
with no other output nearby.
After commit d92cff89a0c8 ("net_dbg_ratelimited: turn into no-op when
!DEBUG") the bug is fixed for the DEBUG case. However, there's no
output at all for CONFIG_DYNAMIC_DEBUG case.
This patch restores debug output (if enabled) for the
CONFIG_DYNAMIC_DEBUG case.
Add a definition of net_dbg_ratelimited() for the CONFIG_DYNAMIC_DEBUG
case. The implementation takes care to check that dynamic debugging is
enabled before calling net_ratelimit().
Fixes: d92cff89a0c8 ("net_dbg_ratelimited: turn into no-op when !DEBUG")
Signed-off-by: Tim Bingham <tbingham@akamai.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/net.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -245,7 +245,15 @@ 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, fmt, ##__VA_ARGS__); \
+} while (0)
+#elif defined(DEBUG)
#define net_dbg_ratelimited(fmt, ...) \
net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
#else
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.5 000/101] 4.5.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 051/101] crypto: testmgr - Use kmalloc memory for RSA input Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 005/101] net: sched: do not requeue a NULL skb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 047/101] mm: thp: calculate the mapcount correctly for THP pages during WP faults Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 060/101] pinctrl: at91-pio4: fix pull-up/down logic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 002/101] decnet: Do not build routes to devices without decnet private data. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 019/101] net/mlx4_en: fix spurious timestamping callbacks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 009/101] net: use skb_postpush_rcsum instead of own implementations Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 053/101] ALSA: usb-audio: Yet another Phoneix Audio device quirk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 057/101] spi: pxa2xx: Do not detect number of enabled chip selects on Intel SPT Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 048/101] crypto: qat - fix invalid pf2vf_resp_wq logic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 055/101] ALSA: hda - Fix white noise on Asus UX501VW headset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 045/101] ocfs2: fix posix_acl_create deadlock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 064/101] vfs: add vfs_select_inode() helper Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 062/101] perf diff: Fix duplicated output column Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 046/101] zsmalloc: fix zs_can_compact() integer overflow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 052/101] ALSA: usb-audio: Quirk for yet another Phoenix Audio devices (v2) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 023/101] samples/bpf: fix trace_output example Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 041/101] net: thunderx: avoid exposing kernel stack Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 016/101] net/mlx5e: Fix minimum MTU Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 050/101] crypto: hash - Fix page length clamping in hash walk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 043/101] net/route: enforce hoplimit max value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 024/101] net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 061/101] regmap: spmi: Fix regmap_spmi_ext_read in multi-byte case Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 029/101] sch_dsmark: update backlog as well Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 021/101] bpf: fix refcnt overflow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 [PATCH 4.5 049/101] crypto: qat - fix adf_ctl_drv.c:undefined reference to adf_init_pf_wq Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-17 03:50 +0200 Re: [PATCH 4.5 000/101] 4.5.5-stable review Guenter Roeck <linux@roeck-us.net> - 2016-05-17 19:30 +0200 Re: [PATCH 4.5 000/101] 4.5.5-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-05-17 19:30 +0200
csiph-web