Page MenuHomeFreeBSD

minidump: Parameterize minidumpsys()
ClosedPublic

Authored by mhorne on Sep 16 2021, 6:39 PM.

Details

Summary

The minidump code is written assuming that certain global state will not
change, and rightly so, since it executes from a kernel debugger
context. In order to support taking minidumps of a live system, we
should allow copies of relevant global state that is likely to change to
be passed as parameters to the minidumpsys() function.

This patch does the work of parameterizing this function, by adding a
struct minidumpstate argument. For now, this struct allows for copies of
the kernel message buffer, and the bitset that tracks which pages should
be dumped (vm_page_dump). Follow-up changes will actually make use of
these arguments.

Notably, dump_avail[] does not need a snapshot, since it is not expected
to change after system initialization.

The existing minidumpsys() definitions are renamed, and a thin MI
wrapper is added to kern_dump.c, which handles the construction of
the state struct. Thus, calling minidumpsys() remains as simple as
before.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 41631
Build 38520: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Sep 16 2021, 6:52 PM
sys/kern/kern_dump.c
465

Should *state be const?

Make the state pointer const.

This revision now requires review to proceed.Sep 21 2021, 6:54 PM
This revision is now accepted and ready to land.Sep 22 2021, 3:27 PM
This revision was automatically updated to reflect the committed changes.