aboutsummaryrefslogtreecommitdiff
path: root/kernel/printk/nmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/printk/nmi.c')
-rw-r--r--kernel/printk/nmi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/printk/nmi.c b/kernel/printk/nmi.c
index 303cf0d15e57..572f94922230 100644
--- a/kernel/printk/nmi.c
+++ b/kernel/printk/nmi.c
@@ -39,6 +39,7 @@
*/
DEFINE_PER_CPU(printk_func_t, printk_func) = vprintk_default;
static int printk_nmi_irq_ready;
+atomic_t nmi_message_lost;
#define NMI_LOG_BUF_LEN (4096 - sizeof(atomic_t) - sizeof(struct irq_work))
@@ -64,8 +65,10 @@ static int vprintk_nmi(const char *fmt, va_list args)
again:
len = atomic_read(&s->len);
- if (len >= sizeof(s->buffer))
+ if (len >= sizeof(s->buffer)) {
+ atomic_inc(&nmi_message_lost);
return 0;
+ }
/*
* Make sure that all old data have been read before the buffer was