LU 6.2 API Application Programmer's Reference Guide (30294-90008)

Chapter 7 137
Debugging
The User Trace
The User Trace
User tracing records intrinsic calls and data for a single transaction
program, including all conversations in which the transaction program
is engaged. Tracing can be turned on using the
TraceOn
parameter of
the TPStarted intrinsic. Once the trace has been turned on, it remains
on until TPEnded is called. Entries are written to the trace file at the
completion of each intrinsic call. See Chapter 5 , “Intrinsic
Descriptions,” for descriptions of the TPStarted and TPEnded intrinsics.
User tracing should be enabled during program development so that
the trace will always be available for debugging. It is common practice
to disable user tracing after a program has been debugged. However, if
a problem arises after the program is in use, enabling tracing again
may help to diagnose the problem.
You can enable or disable user tracing without recompiling the program
by creating a control file that passes the desired tracing value to the
TPStarted intrinsic, or by coding your program to accept an info string
from the MPE RUN command that contains the
TraceOn
value.
NOTE
Develop each TP in a separate group on the HP 3000 to avoid trace file
confusion.
You can specify a name for your trace file in the
TraceFile
parameter
of the TPStarted intrinsic, or you can allow the trace file name to
default.
If you specify a name for the trace file, the file will be overwritten each
time the program is run with tracing enabled. Separate processes of the
same TP will try to open and overwrite the same trace file. The first
process started will overwrite the old trace file, but subsequent
processes will be unable to start, because the trace file they need to
open is in use.
If you use the default name, each TP process will open a separate trace
file. You can use the
DefaultFile
parameter of the TPStarted intrinsic
to find out which trace file is associated with which process, or you can
distinguish between trace files of different processes or different TPs by
reading the time stamp at the beginning of the trace.