diff options
author | John Ogness <john.ogness@linutronix.de> | 2023-01-09 11:13:58 +0106 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2023-01-11 15:35:11 +0100 |
commit | c4fcc617e148791fc45fd33b124301cb596bcbf6 (patch) | |
tree | 668512d287559870a9a62766d142ec1311813356 /scripts/gdb/linux/modules.py | |
parent | 2830eec14afd18c7af333b5222f47a1244adea11 (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 'scripts/gdb/linux/modules.py')
0 files changed, 0 insertions, 0 deletions