Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_dump.c
Show All 26 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/conf.h> | #include <sys/conf.h> | ||||
#include <sys/cons.h> | #include <sys/cons.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/proc.h> | |||||
#include <sys/kerneldump.h> | #include <sys/kerneldump.h> | ||||
#include <sys/msgbuf.h> | |||||
#include <sys/proc.h> | |||||
#include <sys/watchdog.h> | #include <sys/watchdog.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_param.h> | #include <vm/vm_param.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/vm_phys.h> | #include <vm/vm_phys.h> | ||||
#include <vm/vm_dumpset.h> | #include <vm/vm_dumpset.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <machine/dump.h> | #include <machine/dump.h> | ||||
#include <machine/elf.h> | #include <machine/elf.h> | ||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
CTASSERT(sizeof(struct kerneldumpheader) == 512); | CTASSERT(sizeof(struct kerneldumpheader) == 512); | ||||
#define MD_ALIGN(x) roundup2((off_t)(x), PAGE_SIZE) | #define MD_ALIGN(x) roundup2((off_t)(x), PAGE_SIZE) | ||||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | if (error == ECANCELED) | ||||
printf("\nDump aborted\n"); | printf("\nDump aborted\n"); | ||||
else if (error == E2BIG || error == ENOSPC) | else if (error == E2BIG || error == ENOSPC) | ||||
printf("\nDump failed. Partition too small.\n"); | printf("\nDump failed. Partition too small.\n"); | ||||
else | else | ||||
printf("\n** DUMP FAILED (ERROR %d) **\n", error); | printf("\n** DUMP FAILED (ERROR %d) **\n", error); | ||||
return (error); | return (error); | ||||
} | } | ||||
#if MINIDUMP_PAGE_TRACKING == 1 | |||||
/* Minidump progress bar */ | /* Minidump progress bar */ | ||||
static struct { | static struct { | ||||
const int min_per; | const int min_per; | ||||
const int max_per; | const int max_per; | ||||
bool visited; | bool visited; | ||||
} progress_track[10] = { | } progress_track[10] = { | ||||
{ 0, 10, false}, | { 0, 10, false}, | ||||
{ 10, 20, false}, | { 10, 20, false}, | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if (sofar < progress_track[i].min_per || | ||||
continue; | continue; | ||||
if (!progress_track[i].visited) { | if (!progress_track[i].visited) { | ||||
progress_track[i].visited = true; | progress_track[i].visited = true; | ||||
printf("..%d%%", sofar); | printf("..%d%%", sofar); | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
int | |||||
minidumpsys(struct dumperinfo *di) | |||||
{ | |||||
struct minidumpstate state; | |||||
kib: Should *state be const? | |||||
int error; | |||||
state.msgbufp = msgbufp; | |||||
state.dump_bitset = vm_page_dump; | |||||
error = cpu_minidumpsys(di, &state); | |||||
return (error); | |||||
} | |||||
#endif /* MINIDUMP_PAGE_TRACKING == 1 */ |
Should *state be const?