aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/amd64/dump_machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/amd64/amd64/dump_machdep.c')
-rw-r--r--sys/amd64/amd64/dump_machdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/amd64/amd64/dump_machdep.c b/sys/amd64/amd64/dump_machdep.c
index d9badb78ea7e..b3ad765892ad 100644
--- a/sys/amd64/amd64/dump_machdep.c
+++ b/sys/amd64/amd64/dump_machdep.c
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/cons.h>
+#include <sys/sysctl.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
#include <vm/vm.h>
@@ -40,6 +41,11 @@ __FBSDID("$FreeBSD$");
CTASSERT(sizeof(struct kerneldumpheader) == 512);
+int do_minidump = 1;
+TUNABLE_INT("debug.minidump", &do_minidump);
+SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0,
+ "Enable mini crash dumps");
+
/*
* Don't touch the first SIZEOF_METADATA bytes on the dump device. This
* is to protect us from metadata and to protect metadata from us.
@@ -272,6 +278,10 @@ dumpsys(struct dumperinfo *di)
size_t hdrsz;
int error;
+ if (do_minidump) {
+ minidumpsys(di);
+ return;
+ }
bzero(&ehdr, sizeof(ehdr));
ehdr.e_ident[EI_MAG0] = ELFMAG0;
ehdr.e_ident[EI_MAG1] = ELFMAG1;