lkml.org 
[lkml]   [2016]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v4 1/2] ratelimit: Extend to print suppressed messages on release
On Fri,  8 Jul 2016 11:18:49 +0200 Borislav Petkov <bp@alien8.de> wrote:

> From: Borislav Petkov <bp@suse.de>
>
> Extend the ratelimiting facility to print the amount of suppressed lines
> when it is being released.

Why? What's driving this? What are the benefits to our users? Are
there any downsides or back-compatibility issues?

I see from the code that this is not actually enabled by default. The
client code must use ratelimit_set_flags() to select this behaviour,
and the second patch uses this. Please include all such info in the
changelog.

> Separated from a previous patch by Linus.
>
> Also, make the ON_RELEASE image not use "callbacks" as it is misleading.

"image"?

I don't understand this sentence. What's misleading about what? Much
more detail please.

>
> ...
>
> --- a/lib/ratelimit.c
> +++ b/lib/ratelimit.c
> @@ -46,12 +46,14 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
> rs->begin = jiffies;
>
> if (time_is_before_jiffies(rs->begin + rs->interval)) {
> - if (rs->missed)
> - printk(KERN_WARNING "%s: %d callbacks suppressed\n",
> - func, rs->missed);
> + if (rs->missed) {
> + if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) {
> + pr_warn("%s: %d callbacks suppressed\n", func, rs->missed);
> + rs->missed = 0;
> + }
> + }

hm, what's the difference between an output line being suppressed and a
callback being suppressed? I think I've forgotten how this code works ;)

> rs->begin = jiffies;
> rs->printed = 0;
> - rs->missed = 0;
> }
> if (rs->burst && rs->burst > rs->printed) {
> rs->printed++;

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