]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case
authorTim Bingham <tbingham@akamai.com>
Fri, 29 Apr 2016 17:30:23 +0000 (13:30 -0400)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commit0d9776dbbabfb37975406898235034726234ad51
tree84f5c6797b5fe94eb5d901346bec84f399b44a66
parentdbb768827053462da635895727f2a685d8c5b29b
net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case

BugLink: http://bugs.launchpad.net/bugs/1584912
[ 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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
include/linux/net.h