summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2020-11-30 03:36:06 +0300
committerMinda Chen <minda.chen@starfivetech.com>2023-11-06 14:24:37 +0300
commit69dbe75e276a599b0899f90c2af6e547dd81fd7e (patch)
treec0bf6a80328b0ac64ed7030e480dc0d4eec933ef /include
parent13f94a9f0bb8b7d4f85d08e0a08adbf2fb9f1201 (diff)
downloadlinux-69dbe75e276a599b0899f90c2af6e547dd81fd7e.tar.xz
printk: introduce kernel sync mode
When the kernel performs an OOPS, enter into "sync mode": - only atomic consoles (write_atomic() callback) will print - printing occurs within vprintk_store() instead of console_unlock() CONSOLE_LOG_MAX is moved to printk.h to support the per-console buffer used in sync mode. Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/console.h4
-rw-r--r--include/linux/printk.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index b0e783248b20..4dd8b0ce417d 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -16,6 +16,7 @@
#include <linux/atomic.h>
#include <linux/types.h>
+#include <linux/printk.h>
struct vc_data;
struct console_font_op;
@@ -150,6 +151,9 @@ struct console {
short flags;
short index;
int cflag;
+#ifdef CONFIG_PRINTK
+ char sync_buf[CONSOLE_LOG_MAX];
+#endif
void *data;
struct console *next;
};
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 453458c722f5..fb82a5e15b9d 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -47,6 +47,12 @@ static inline const char *printk_skip_headers(const char *buffer)
#define CONSOLE_EXT_LOG_MAX 8192
+/*
+ * The maximum size of a record formatted for console printing
+ * (i.e. with the prefix prepended to every line).
+ */
+#define CONSOLE_LOG_MAX 1024
+
/* printk's without a loglevel use this.. */
#define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT