From: Matthew Dillon Date: Thu, 16 Aug 2012 16:11:07 +0000 (-0700) Subject: kernel - Stop KTR logging during panic X-Git-Tag: v3.0.3~7 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1ecd457f72707d1dd6302a104d25bd9f6c74344b 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 e4c819c..2963c79 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();