[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d513c80-8c8e-17b6-5b9c-73c7bca77252@i-love.sakura.ne.jp>
Date: Thu, 7 May 2020 09:50:21 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: Joe Perches <joe@...ches.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
linux-kernel@...r.kernel.org, Dmitry Safonov <dima@...sta.com>,
Michal Hocko <mhocko@...e.com>,
Yafang Shao <laoar.shao@...il.com>
Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles".
On 2020/05/07 0:26, Joe Perches wrote:
> On Wed, 2020-05-06 at 18:45 +0900, Tetsuo Handa wrote:
>> On 2020/04/28 20:33, Tetsuo Handa wrote:
>>> On 2020/04/27 15:21, Sergey Senozhatsky wrote:
>>>>> KERN_NO_CONSOLES is for type of messages where "saved for later analysis" is
>>>>> important but "printed for immediate notification" is not important.
>>>>> In other words, KERN_NO_CONSOLES is NOT for dying messages where "printed for
>>>>> immediate notification" is important.
>>>>
>>>> per-console loglevel is a user configurable parameter.
>>>> KERN_NO_CONSOLES is a hard-coded policy.
>>>
>>> But given that whether to use KERN_NO_CONSOLES is configurable via e.g. sysctl,
>>> KERN_NO_CONSOLES will become a user configurable parameter. What's still wrong?
>>>
>>
>> Any problems remaining?
>
> printk_get_level / printk_skip_level and the various
> uses of %pV using printk_get_level
>
Excuse me, but what do you mean?
I wish printk() accepts "loglevel" argument detached from "fmt" argument (e.g.
int printkl(int loglevel, const char *fmt_without_loglevel, ...);
int vprintkl(int loglevel, const char *fmt_without_loglevel, va_list args);
) so that users of KERN_NO_CONSOLES need not to do like
if (sysctl_no_console_for_XX)
printk(KERN_INFO KERN_NO_CONSOLES pr_fmt(fmt) "%s\n", "hello");
else
printk(KERN_INFO pr_fmt(fmt) "%s\n", "hello");
or
printk("%s" pr_fmt(fmt) "%s\n", sysctl_no_console_for_XX ? KERN_INFO KERN_NO_CONSOLES : KERN_INFO, "hello");
in order to conditionally embed KERN_NO_CONSOLES into
pr_info("%s\n", "hello");
. But this patch is about whether KERN_NO_CONSOLES is acceptable. How to
pass KERN_NO_CONSOLES (if KERN_NO_CONSOLES is acceptable) is a future patch.
Powered by blists - more mailing lists