lkml.org 
[lkml]   [2016]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -v3.1 1/2] ratelimit: Extend to print suppressed messages on release
From
Date
On Wed, 2016-07-06 at 15:28 +0200, Borislav Petkov wrote:
> Extend the ratelimiting facility to print the amount of suppressed lines
> when it is being released.
[]
> diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
[]
> +static inline void ratelimit_state_exit(struct ratelimit_state *rs)
> +{
> + if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE))
> + return;
> +
> + if (rs->missed)
> + printk(KERN_WARNING "%s: %d output lines suppressed due to ratelimiting\n",
> +        current->comm, rs->missed);

Please use pr_warn as it will use whatever
pr_fmt prefix is specified by the subsystem.

Maybe:
if (rs->missed)
pr_warn("ratelimit: %s: %d output lines suppressed\n",
current->comm, rs->missed);

to be more similar to the callback suppressed message in
lib/ratelimit.c

pr_warn("%s: %d callbacks suppressed\n", func, rs->missed);

\
 
 \ /
  Last update: 2016-07-06 17:21    [W:0.074 / U:12.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site