A simple tracing facility is available for determining what messages are
received by and sent from the Prolog servant. When message tracing is on,
messages sent or received cause a trace message to be written to the current
output stream. It will normally be redirected to a file by
create_servant/3
or QP_ipc_create_servant()
. The
UNIX command tail -f may be helpful in looking at the trace messages.
Each trace message indicates what the corresponding interprocess message was.
The precise
form of the trace information depends on whether the Prolog servant is serving
a C program or another Prolog program.
Message tracing can be turned on and off by having the servant process call
msg_trace/2
which is described below. A master that is a Prolog process
can use call_servant/1
to cause the servant to call msg_trace/2
.
It can also call msg_trace/2
directly to control tracing of its own
messages.
To make a servant that serves a C master trace its message, it must either
have had tracing turned on before its saved state was created, or it must
provide an external
routine that can be invoked by the C master to turn
on tracing (see Example 4 in ipc-rpc-cpp-exa).