Skip to content
Commit 2c94b537 authored by Tim Bingham's avatar Tim Bingham Committed by David S. Miller
Browse files

net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case

Prior to commit d92cff89 ("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 d92cff89 ("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: d92cff89

 ("net_dbg_ratelimited: turn into no-op when !DEBUG")
Signed-off-by: default avatarTim Bingham <tbingham@akamai.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent efe79050
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment