Forcing Core Dumps
The Aprobe error facility, accessed through ap_Error()
, provides a mechanism for Aprobe and probes to report errors.
Normally Aprobe will only dump core if a severe error occurs and Aprobe cannot continue reasonably. This generally means Aprobe has run out of memory or cannot correctly patch the program. These core dumps can help with debugging the problem.
Check the list of severity levels in $APROBE/include/aprobe.h
. Normally, Aprobe will dump core for ap_DumpCoreSev
or ap_SysDumpCoreSev
.
In some case you may want to force Aprobe to core dump for a less severe error to help with your debugging. This can be accomplished using the DUMP_CORE_IF_ERROR
or DUMP_CORE_IF_MESSAGE
environment variables.
DUMP_CORE_IF_ERROR
You can set this variable to the severity level at which you want to trigger Aprobe to dump core, like this:
export DUMP_CORE_IF_ERROR=3
Any error severity at or above the set value, ap_Fatal_Sev
in this case, will cause Aprobe to abort with a core dump.
DUMP_CORE_IF_MESSAGE
You can set this variable to a string contained in the message you want to trigger Aprobe to dump core, like this:
export DUMP_CORE_IF_MESSAGE="my trigger message"
Any error message which contains the set value will cause Aprobe to abort with a core dump.