Page MenuHomeFreeBSD

Allow minidumps to be performed on the live system
ClosedPublic

Authored by mhorne on Sep 16 2021, 6:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 12:11 PM
Unknown Object (File)
Thu, Mar 21, 11:28 PM
Unknown Object (File)
Feb 9 2024, 5:14 PM
Unknown Object (File)
Jan 19 2024, 8:21 AM
Unknown Object (File)
Jan 8 2024, 1:09 AM
Unknown Object (File)
Dec 23 2023, 3:37 AM
Unknown Object (File)
Dec 16 2023, 5:44 PM
Unknown Object (File)
Dec 12 2023, 5:38 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41551
Build 38440: arc lint + arc unit

Event Timeline

sys/kern/kern_dump.c
479

The bitset may change even during copying.

I would suggest explaining a bit further why this is ok and in particular try to characterize the inconsistencies that can result.

489

What about a kernel that is configured to dump core and reboot automatically upon a panic? Is kdb_active == 1 in that case? I think not.

sys/kern/kern_dump.c
489

Right, I think what we want is kdb_active || KERNEL_PANICKED().

sys/kern/kern_dump.c
489

IMO it would be reasonable to also/instead assert dumping (and assert !dumping in the live case).

Fix the assertions, first cut at a more detailed block comment.

This revision is now accepted and ready to land.Sep 23 2021, 5:04 PM
markj added inline comments.
sys/kern/subr_msgbuf.c
425

Style no longer requires this blank line.