This module contains functions for sending system messages used by programs, and messaged 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 following types are used in the functions defined below:
The default timeout is 5000 ms, unless otherwise specified. The
The functions make reference to a debug structure.
The debug structure is a list of
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.
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
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.
The following functions are used when implementing a special process. This is an ordinary process which does not use a standard behaviour, but a process which understands the standard system messages.
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