Page MenuHomeFreeBSD

minidump: Parameterize minidumpsys()

Authored by mhorne on Sep 16 2021, 6:39 PM.
Referenced Files
Unknown Object (File)
Apr 28 2023, 9:28 PM
Unknown Object (File)
Jan 19 2023, 4:54 PM



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

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sep 16 2021, 6:52 PM

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.