summaryrefslogtreecommitdiff
path: root/kernel/printk/internal.h
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2023-01-09 11:13:58 +0106
committerPetr Mladek <pmladek@suse.com>2023-01-11 15:35:11 +0100
commitc4fcc617e148791fc45fd33b124301cb596bcbf6 (patch)
tree668512d287559870a9a62766d142ec1311813356 /kernel/printk/internal.h
parent2830eec14afd18c7af333b5222f47a1244adea11 (diff)
printk: introduce console_prepend_dropped() for dropped messages
Currently "dropped messages" are separately printed immediately before printing the printk message. Since normal consoles are now using an output buffer that is much larger than previously, the "dropped message" could be prepended to the printk message and then output everything in a single write() call. Introduce a helper function console_prepend_dropped() to prepend an existing message with a "dropped message". This simplifies the code by allowing all message formatting to be handled together and then only requires a single write() call to output the full message. And since this helper does not require any locking, it can be used in the future for other console printing contexts as well. Note that console_prepend_dropped() is defined as a NOP for !CONFIG_PRINTK. Although the function will never be called for !CONFIG_PRINTK, compiling the function can lead to warnings of "always true" conditionals due to the size macro values used in !CONFIG_PRINTK. Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20230109100800.1085541-7-john.ogness@linutronix.de
Diffstat (limited to 'kernel/printk/internal.h')
-rw-r--r--kernel/printk/internal.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h
index c9bb0cd86372..72df730597f1 100644
--- a/kernel/printk/internal.h
+++ b/kernel/printk/internal.h
@@ -26,9 +26,6 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
/* the maximum size of a formatted extended record */
#define CONSOLE_EXT_LOG_MAX 8192
-/* the maximum size for a dropped text message */
-#define DROPPED_TEXT_MAX 64
-
/* the maximum size allowed to be reserved for a record */
#define LOG_LINE_MAX (CONSOLE_LOG_MAX - PREFIX_MAX)
@@ -69,7 +66,6 @@ u16 printk_parse_prefix(const char *text, int *level,
#define PREFIX_MAX 0
#define CONSOLE_LOG_MAX 0
#define CONSOLE_EXT_LOG_MAX 0
-#define DROPPED_TEXT_MAX 0
#define LOG_LINE_MAX 0
/*