[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o7rfd96w.fsf@jogness.linutronix.de>
Date: Tue, 03 Jan 2023 14:50:23 +0106
From: John Ogness <john.ogness@...utronix.de>
To: Petr Mladek <pmladek@...e.com>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH printk v3 6/6] printk: introduce
console_prepend_dropped() for dropped messages
On 2023-01-03, Petr Mladek <pmladek@...e.com> wrote:
> Well, what about making sure that something more useful is always
> printed. For example:
>
> /*
> * Make sure outbuf is sufficiently large before prepending.
> * Keep at least the prefix when the message has to be truncated.
> * It is a rather theoretical problem when someone tries to
> * use a minimalist buffer.
> */
> if (WARN_ON_ONCE(len + PREFIX_MAX + 1 >= outbuf_sz))
> return;
I am fine with this. We won't see this warning anyway. Few lines would
ever be printed correctly if anyone ever tries to use a buffer so small.
> If we want to use this way. It would probably make sense to
> rename PREFIX_MAX to CONSOLE_PREFIX_MAX.
Actually, I would like to rename all of those limit macros to something
that makes more sense for the new code base:
CONSOLE_EXT_LOG_MAX -> CONSOLE_MESSAGE_MAX
CONSOLE_LOG_MAX -> SYSLOG_MESSAGE_MAX
LOG_LINE_MAX -> PRINTK_RECORD_MAX
PREFIX_MAX -> CONSOLE_PREFIX_MAX
I have a patch to do this ready, but I did not want to post it until we
are finished with the thread/atomic work.
John
Powered by blists - more mailing lists