This module contains functions for sending system messages used by programs, and messages used for debugging purposes.
Functions used for implementation of processes
should also understand system messages such as debugging
messages and code change. These functions must be used to implement the use of system messages for a process; either directly, or through standard behaviours, such as
The default timeout is 5000 ms, unless otherwise specified. The
Processes which are not implemented as one of the standard behaviours must still understand system messages. There are three different messages which must be understood:
Plain system messages. These are received as
Shutdown messages. If the process traps exits, it must
be able to handle an shut-down request from its parent, the
supervisor. The message
There is one more message which the process must understand if the modules used to implement the process change dynamically during runtime. An example of such a process is the
This message is used by the release handler to find which processes execute a certain module. The process may at a later time be suspended and ordered to perform a code change for one of its modules.
When debugging a process with the functions of this
module, the process generates system_events which are
then treated in the debug function. For example,
There are three predefined system events which are used when a process receives or sends a message. The process can also define its own system events. It is always up to the process itself to format these events.
See
Turns the logging of system events On or Off. If On, a
maximum of
Enables or disables the logging of all system events in textual
format to the file. The events are formatted with a function that is
defined by the process that generated the event (with a call
to
Enables or disables the collection of statistics. If
Prints all system events on
Turns off all debugging for the process. This includes
functions that have been installed explicitly with the
Suspends the process. When the process is suspended, it will only respond to other system messages, but not other messages.
Resumes a suspended process.
Tells the process to change code. The process must be
suspended to handle this message. The
Gets the status of the process.
The value of
Gets the state of the process.
These functions are intended only to help with debugging. They are provided for
convenience, allowing developers to avoid having to create their own state extraction
functions and also avoid having to interactively extract state from the return values of
The value of
If the callback module exports a
If the callback module does not export a
If the callback module's
The
To obtain more information about a process, including its state, see
Replaces the state of the process, and returns the new state.
These functions are intended only to help with debugging, and they should not be be called from normal code. They are provided for convenience, allowing developers to avoid having to create their own custom state replacement functions.
The
If a
If a
If the callback module exports a
If the callback module does not export a
If the callback module's
The
This function makes it possible to install other debug functions than the ones defined above. An example of such a function is a trigger, a function that waits for some special event and performs some action when the event is generated. This could, for example, be turning on low level tracing.
Removes a previously installed debug function from the
process.
This function orders the process to terminate with the
given
This function can be used by a process that initiates a debug
structure from a list of options. The values of the
This function gets the data associated with a debug option.
This function is called by a process when it generates a
system event.
This function is used by a process module that wishes to take care of system
messages. The process receives a
This function never returns. It calls the function
The
Prints the logged system events in the debug structure
using
This function is called from
This function is called from
Called from
This function is called from
This function is called from