]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Allow minidumps to be performed on the live system
authorMitchell Horne <mhorne@FreeBSD.org>
Wed, 17 Nov 2021 15:35:59 +0000 (11:35 -0400)
committerMitchell Horne <mhorne@FreeBSD.org>
Fri, 19 Nov 2021 19:05:53 +0000 (15:05 -0400)
commit588ab3c7745480778281ce2ab086eacfb487e413
tree064d039c29c538224ab80ce724033ed70b979256
parent10fe6f80a6c871ba317ddc2684cecb8f02096943
Allow minidumps to be performed on the live system

Add a boolean parameter to minidumpsys(), to indicate a live dump. When
requested, take a snapshot of important global state, and pass this to
the machine-dependent minidump function. For now this includes the
kernel message buffer, and the bitset of pages to be dumped. Beyond
this, we don't take much action to protect the integrity of the dump
from changes in the running system.

A new function msgbuf_duplicate() is added for snapshotting the message
buffer. msgbuf_copy() is insufficient for this purpose since it marks
any new characters it finds as read.

For now, nothing can actually trigger a live minidump. A future patch
will add the mechanism for this. For simplicity and safety, live dumps
are disallowed for mips.

Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31993
sys/kern/kern_dump.c
sys/kern/subr_msgbuf.c
sys/mips/mips/minidump_machdep.c
sys/sys/kerneldump.h
sys/sys/msgbuf.h