[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o8stmz57.fsf@linutronix.de>
Date: Wed, 18 Mar 2020 17:00:20 +0100
From: John Ogness <john.ogness@...utronix.de>
To: Eugeniu Rosca <roscaeugeniu@...il.com>
Cc: linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Jisheng Zhang <Jisheng.Zhang@...aptics.com>,
Valdis Kletnieks <valdis.kletnieks@...edu>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Andrew Gabbasov <andrew_gabbasov@...tor.com>,
Dirk Behme <dirk.behme@...bosch.com>,
Eugeniu Rosca <erosca@...adit-jv.com>
Subject: Re: [RFC PATCH 2/3] printk: add console_verbose_{start,end}
On 2020-03-15, Eugeniu Rosca <roscaeugeniu@...il.com> wrote:
> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index 1e6108b8d15f..14755ef7b017 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -3,6 +3,7 @@
> #define __KERNEL_PRINTK__
>
> #include <stdarg.h>
> +#include <linux/atomic.h>
> #include <linux/init.h>
> #include <linux/kern_levels.h>
> #include <linux/linkage.h>
> @@ -77,6 +78,15 @@ static inline void console_verbose(void)
> console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
> }
>
> +#ifdef CONFIG_PRINTK
> +extern atomic_t ignore_loglevel;
> +static inline void console_verbose_start(void) { atomic_inc(&ignore_loglevel); }
> +static inline void console_verbose_end(void) { atomic_dec(&ignore_loglevel); }
To be compatible with console_verbose() semantics, this should also
respect console_loglevel=0. Perhaps by updating
suppress_message_printing() to be something like:
static bool suppress_message_printing(int level)
{
return (!console_loglevel ||
(level >= console_loglevel && !ignore_loglevel));
}
John Ogness
Powered by blists - more mailing lists