diff options
author | cem <cem@FreeBSD.org> | 2016-04-15 17:45:12 +0000 |
---|---|---|
committer | cem <cem@FreeBSD.org> | 2016-04-15 17:45:12 +0000 |
commit | 98188ed5c2caae40b8e4ca0485baa690f5d10a78 (patch) | |
tree | 0b0043fac6329303bacfbbf1d228fc0ded072146 /sys/sys/conf.h | |
parent | 12232f84636cebecfa250541cfbf09b07fe2f520 (diff) | |
download | FreeBSD-src-98188ed5c2caae40b8e4ca0485baa690f5d10a78.zip FreeBSD-src-98188ed5c2caae40b8e4ca0485baa690f5d10a78.tar.gz |
Add 4Kn kernel dump support
(And 4Kn minidump support, but only for amd64.)
Make sure all I/O to the dump device is of the native sector size. To
that end, we keep a native sector sized buffer associated with dump
devices (di->blockbuf) and use it to pad smaller objects as needed (e.g.
kerneldumpheader).
Add dump_write_pad() as a convenience API to dump smaller objects with
zero padding. (Rather than pull in NPM leftpad, we wrote our own.)
Savecore(1) has been updated to deal with these dumps. The format for
512-byte sector dumps should remain backwards compatible.
Minidumps for other architectures are left as an exercise for the
reader.
PR: 194279
Submitted by: ambrisko@
Reviewed by: cem (earlier version), rpokala
Tested by: rpokala (4Kn/512 except 512 fulldump), cem (512 fulldump)
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5848
Diffstat (limited to 'sys/sys/conf.h')
-rw-r--r-- | sys/sys/conf.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 6d2cac9..b7d9756 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -328,15 +328,18 @@ EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn); struct dumperinfo { dumper_t *dumper; /* Dumping function. */ - void *priv; /* Private parts. */ - u_int blocksize; /* Size of block in bytes. */ + void *priv; /* Private parts. */ + u_int blocksize; /* Size of block in bytes. */ u_int maxiosize; /* Max size allowed for an individual I/O */ - off_t mediaoffset; /* Initial offset in bytes. */ - off_t mediasize; /* Space available in bytes. */ + off_t mediaoffset; /* Initial offset in bytes. */ + off_t mediasize; /* Space available in bytes. */ + void *blockbuf; /* Buffer for padding shorter dump blocks */ }; int set_dumper(struct dumperinfo *, const char *_devname, struct thread *td); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); +int dump_write_pad(struct dumperinfo *, void *, vm_offset_t, off_t, size_t, + size_t *); int doadump(boolean_t); extern int dumping; /* system is dumping */ |