diff options
author | alfred <alfred@FreeBSD.org> | 2010-03-02 06:58:58 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2010-03-02 06:58:58 +0000 |
commit | f34ce3dd384c7e26c5474a869851a24b36a10df2 (patch) | |
tree | f83c2f2fdc768503cc062e89b74034f42a21dc98 /sys/sys/eventhandler.h | |
parent | 8f72bf4ef06c0868171b0ca88af8f0671c7aedee (diff) | |
download | FreeBSD-src-f34ce3dd384c7e26c5474a869851a24b36a10df2.zip FreeBSD-src-f34ce3dd384c7e26c5474a869851a24b36a10df2.tar.gz |
Merge projects/enhanced_coredumps (r204346) into HEAD:
Enhanced process coredump routines.
This brings in the following features:
1) Limit number of cores per process via the %I coredump formatter.
Example:
if corefilename is set to %N.%I.core AND num_cores = 3, then
if a process "rpd" cores, then the corefile will be named
"rpd.0.core", however if it cores again, then the kernel will
generate "rpd.1.core" until we hit the limit of "num_cores".
this is useful to get several corefiles, but also prevent filling
the machine with corefiles.
2) Encode machine hostname in core dump name via %H.
3) Compress coredumps, useful for embedded platforms with limited space.
A sysctl kern.compress_user_cores is made available if turned on.
To enable compressed coredumps, the following config options need to be set:
options COMPRESS_USER_CORES
device zlib # brings in the zlib requirements.
device gzio # brings in the kernel vnode gzip output module.
4) Eventhandlers are fired to indicate coredumps in progress.
5) The imgact sv_coredump routine has grown a flag to pass in more
state, currently this is used only for passing a flag down to compress
the coredump or not.
Note that the gzio facility can be used for generic output of gzip'd
streams via vnodes.
Obtained from: Juniper Networks
Reviewed by: kan
Diffstat (limited to 'sys/sys/eventhandler.h')
-rw-r--r-- | sys/sys/eventhandler.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index 1f26d48..6715efc 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -211,7 +211,20 @@ EVENTHANDLER_DECLARE(process_exit, exitlist_fn); EVENTHANDLER_DECLARE(process_fork, forklist_fn); EVENTHANDLER_DECLARE(process_exec, execlist_fn); +/* + * application dump event + */ struct thread; +typedef void (*app_coredump_start_fn)(void *, struct thread *, char *name); +typedef void (*app_coredump_progress_fn)(void *, struct thread *td, int byte_count); +typedef void (*app_coredump_finish_fn)(void *, struct thread *td); +typedef void (*app_coredump_error_fn)(void *, struct thread *td, char *msg, ...); + +EVENTHANDLER_DECLARE(app_coredump_start, app_coredump_start_fn); +EVENTHANDLER_DECLARE(app_coredump_progress, app_coredump_progress_fn); +EVENTHANDLER_DECLARE(app_coredump_finish, app_coredump_finish_fn); +EVENTHANDLER_DECLARE(app_coredump_error, app_coredump_error_fn); + typedef void (*thread_ctor_fn)(void *, struct thread *); typedef void (*thread_dtor_fn)(void *, struct thread *); typedef void (*thread_fini_fn)(void *, struct thread *); |