Page MenuHomeFreeBSD

kern_dump.c: provider a higher-level API for MD dumpsys code
AbandonedPublic

Authored by markj on Jul 12 2015, 2:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 2 2024, 8:58 AM
Unknown Object (File)
Dec 21 2023, 4:18 PM
Unknown Object (File)
Sep 20 2023, 9:41 AM
Unknown Object (File)
Aug 11 2023, 2:47 AM
Unknown Object (File)
Jul 1 2023, 9:33 PM
Unknown Object (File)
May 22 2023, 9:45 AM
Unknown Object (File)
May 9 2023, 5:32 AM
Unknown Object (File)
Feb 10 2023, 5:44 AM
Subscribers

Details

Reviewers
rstone
Summary

At the moment, each of the (mini)dumpsys implementations writes to the
dump medium using dump_write(). In particular, they're required to keep
track of the current offset when writing, and write the kernel dump
headers themselves at the appropriate locations.

This introduces a lot of code duplication. It also makes it difficult to
support compressed dumps, since that requires some more control over the
layout of the dump on disk. This change lifts some of the state into
kern_dump.c and adds some new functions for use by dumpsys
implementations:

  • dump_start and dump_finish are used to perform any needed state initialization and teardown, and are also useful for netdump.
  • dump_append writes a block at the current dump offset. This is effectively the same as dump_write, but the caller does not specify an offset.
  • dump_write is renamed to dump_write_raw to indicate that it provides raw access to the dumper; calling it does not modify any MI dump state. dump_write_raw is only used for textdumps and providers that attempt to stripe kernel dumps across multiple physical disks.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

markj retitled this revision from to kern_dump.c: provider a higher-level API for MD dumpsys code.
markj edited the test plan for this revision. (Show Details)
markj added a reviewer: rstone.
markj updated this object.
markj added a subscriber: cem.

Other than the comment above, looks good to me. Thanks for doing this work!

sys/i386/i386/minidump_machdep.c
253–257

Shouldn't this be dump_start()?

sys/i386/i386/minidump_machdep.c
253–257

Oops, yup. :(

I haven't yet tested/built on !amd64, but I'll test at least i386 soon.

  • - dump_start -> dump_finish