aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek2021-08-30 14:56:28 +0200
committerPetr Mladek2021-08-30 14:56:28 +0200
commitbaa99c926718c1a1549a7e08383f53a8e2944f04 (patch)
tree8f67de8079f31dd743f910d0007fe6cb6c1d0274
parent71af75b6929458d85f63c0649dc26d6f4c19729e (diff)
parent10102a890b543a8a08457dc69fa55bc032403c7d (diff)
Merge branch 'for-5.15-verbose-console' into for-linus
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt9
-rw-r--r--include/linux/printk.h11
-rw-r--r--kernel/printk/printk.c12
3 files changed, 22 insertions, 10 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index bdb22006f713..a4dd5814a83a 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4167,6 +4167,15 @@
Format: <bool> (1/Y/y=enable, 0/N/n=disable)
default: disabled
+ printk.console_no_auto_verbose=
+ Disable console loglevel raise on oops, panic
+ or lockdep-detected issues (only if lock debug is on).
+ With an exception to setups with low baudrate on
+ serial console, keeping this 0 is a good choice
+ in order to provide more debug information.
+ Format: <bool>
+ default: 0 (auto_verbose is enabled)
+
printk.devkmsg={on,off,ratelimit}
Control writing to /dev/kmsg.
on - unlimited logging to /dev/kmsg from userspace
diff --git a/include/linux/printk.h b/include/linux/printk.h
index c1e176403967..da7a1de2257a 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -70,16 +70,7 @@ extern int console_printk[];
#define minimum_console_loglevel (console_printk[2])
#define default_console_loglevel (console_printk[3])
-static inline void console_silent(void)
-{
- console_loglevel = CONSOLE_LOGLEVEL_SILENT;
-}
-
-static inline void console_verbose(void)
-{
- if (console_loglevel)
- console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
-}
+extern void console_verbose(void);
/* strlen("ratelimit") + 1 */
#define DEVKMSG_STR_MAX_SIZE 10
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 8030c670f0bc..87b8e7c81368 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2380,6 +2380,18 @@ module_param_named(console_suspend, console_suspend_enabled,
MODULE_PARM_DESC(console_suspend, "suspend console during suspend"
" and hibernate operations");
+static bool printk_console_no_auto_verbose;
+
+void console_verbose(void)
+{
+ if (console_loglevel && !printk_console_no_auto_verbose)
+ console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
+}
+EXPORT_SYMBOL_GPL(console_verbose);
+
+module_param_named(console_no_auto_verbose, printk_console_no_auto_verbose, bool, 0644);
+MODULE_PARM_DESC(console_no_auto_verbose, "Disable console loglevel raise to highest on oops/panic/etc");
+
/**
* suspend_console - suspend the console subsystem
*