lkml.org 
[lkml]   [2020]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] printk: Add loglevel for "do not print to consoles".
From
Date


On 4/24/20 4:42 PM, Steven Rostedt wrote:
> On Sat, 25 Apr 2020 00:28:53 +0900
> Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
>> For those who analyze log files (instead of console output), the point of
>> printk() is to save kernel messages into log files (via userspace syslog
>> daemon).
>>
>> By the way, I think
>>
>> printk(KERN_NO_CONSOLES "hello\n")
>>
>> is almost same with doing
>>
>> saved_loglevel = console_loglevel;
>> console_loglevel = CONSOLE_LOGLEVEL_SILENT;
>> printk("hello\n");
>> console_loglevel = saved_loglevel;
>>
>> used by vkdb_printf().
>
> And both shouldn't be done within the kernel. The "CONSOLE_LOGLEVEL_SILENT"
> if for user decided policy, not the kernel making that policy for the user.

Though, I believe the reverse KERN_UNSUPPRESSED [1] still makes sense
for sysrq/kdb where user expects their interactive messages to appear on
console. And unfortunately, userspace depends on the loglevel of those
messages as it is.
With KERN_UNSUPPRESSED I hope to remove all those console_loglevel
tricks and make it static variable for printk.

[1]: https://lore.kernel.org/lkml/20190528002412.1625-1-dima@arista.com/

Thanks,
Dmitry

\
 
 \ /
  Last update: 2020-04-24 17:53    [W:0.113 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site