mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
kerneldump: Add flag to indicate kernel core was successfully dumped
This allows for shutdown_final EVENTHANDLERs to know that a core dump successfully occurred. Embedded systems may want to record this fact or act on it. Obtained from: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44542
This commit is contained in:
parent
fe429e6794
commit
2aee804c9e
|
@ -229,6 +229,7 @@ bool scheduler_stopped __read_frequently;
|
|||
|
||||
int dumping __read_mostly; /* system is dumping */
|
||||
int rebooting __read_mostly; /* system is rebooting */
|
||||
bool dumped_core __read_mostly; /* system successfully dumped core */
|
||||
/*
|
||||
* Used to serialize between sysctl kern.shutdown.dumpdevname and list
|
||||
* modifications via ioctl.
|
||||
|
@ -415,10 +416,12 @@ doadump(boolean_t textdump)
|
|||
|
||||
TAILQ_FOREACH(di, &dumper_configs, di_next) {
|
||||
error = dumpsys(di);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
dumped_core = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dumping--;
|
||||
return (error);
|
||||
|
|
|
@ -358,6 +358,7 @@ struct dumperinfo {
|
|||
};
|
||||
|
||||
extern int dumping; /* system is dumping */
|
||||
extern bool dumped_core; /* system successfully dumped kernel core */
|
||||
|
||||
/*
|
||||
* Save registers for later extraction from a kernel dump.
|
||||
|
|
Loading…
Reference in a new issue