mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Eugeniu Rosca <roscaeugeniu@gmail.com>
Cc: linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Jisheng Zhang <Jisheng.Zhang@synaptics.com>,
	Valdis Kletnieks <valdis.kletnieks@vt.edu>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Andrew Gabbasov <andrew_gabbasov@mentor.com>,
	Dirk Behme <dirk.behme@de.bosch.com>,
	Eugeniu Rosca <erosca@de.adit-jv.com>
Subject: Re: [RFC PATCH 2/3] printk: add console_verbose_{start,end}
Date: Wed, 18 Mar 2020 17:00:20 +0100	[thread overview]
Message-ID: <87o8stmz57.fsf@linutronix.de> (raw)
In-Reply-To: <20200315170903.17393-3-erosca@de.adit-jv.com> (Eugeniu Rosca's message of "Sun, 15 Mar 2020 18:09:02 +0100")

On 2020-03-15, Eugeniu Rosca <roscaeugeniu@gmail.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

  reply	other threads:[~2020-03-18 16:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 17:09 [RFC PATCH 0/3] Fix quiet console in pre-panic scenarios Eugeniu Rosca
2020-03-15 17:09 ` [RFC PATCH 1/3] printk: convert ignore_loglevel to atomic_t Eugeniu Rosca
2020-03-15 17:09 ` [RFC PATCH 2/3] printk: add console_verbose_{start,end} Eugeniu Rosca
2020-03-18 16:00   ` John Ogness [this message]
2020-03-15 17:09 ` [RFC PATCH 3/3] watchdog: Turn console verbosity on when reporting softlockup Eugeniu Rosca
2020-03-17  2:18   ` Sergey Senozhatsky
2020-03-18 18:05     ` Eugeniu Rosca
2020-03-19  6:48       ` Sergey Senozhatsky
2020-03-19  7:38         ` Valdis Klētnieks
2020-03-19  8:01           ` Sergey Senozhatsky
2020-03-19  8:18             ` Valdis Klētnieks
2020-05-19 14:43         ` Petr Mladek
2020-03-19  8:20       ` John Ogness
2020-03-16 18:35 ` [RFC PATCH 0/3] Fix quiet console in pre-panic scenarios Steven Rostedt
2020-03-16 19:09   ` Sebastian Andrzej Siewior
2020-03-18 14:56     ` Eugeniu Rosca
2020-03-18 15:40       ` John Ogness

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8stmz57.fsf@linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=Jisheng.Zhang@synaptics.com \
    --cc=andrew_gabbasov@mentor.com \
    --cc=bigeasy@linutronix.de \
    --cc=dirk.behme@de.bosch.com \
    --cc=erosca@de.adit-jv.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=roscaeugeniu@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=valdis.kletnieks@vt.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome