From: Matthew Dillon Date: Thu, 16 Aug 2012 16:11:07 +0000 (-0700) Subject: kernel - Stop KTR logging during panic X-Git-Tag: v3.2.0~380 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/ab1b43851c7b5160ad787019355b96f56534c39a kernel - Stop KTR logging during panic * Stop all KTR logging when a panic occurs so the KTR buffer doesn't get wiped out by events during the panic & core dump. This gives us a KTR buf snapshot as of the panic entry. --- diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index e4c819c92b..2963c792d6 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -419,7 +419,9 @@ ktr_begin_write_entry(struct ktr_info *info, const char *file, int line) cpu = mycpu->gd_cpuid; kcpu = &ktr_cpu[cpu].core; - if (kcpu->ktr_buf == NULL) + if (panicstr) /* stop logging during panic */ + return NULL; + if (kcpu->ktr_buf == NULL) /* too early in boot */ return NULL; crit_enter();