HP-UX SNAplus2 Diagnostics Guide

Using Logging and Tracing
Tracing
Chapter 384
Specify a path for the text file to which trace data will be written. Do not
specify the name of a device (such as /dev/tty) or a print spooler as a
trace file name. If you do not specify a full path for the trace file or files,
SNAplus2 uses the directory from which you start the application.
Controlling API Tracing from within an Application
SNAplus2 provides the ability to control API tracing from within an
application program. You can trace the specific section of a program
where a problem is being encountered without having to trace the whole
application. Tracing can be activated at the start of the section and
deactivated at the end of it.
To use this facility, complete the following steps:
Step 1. Set up the SNATRC environment variable before starting the application
program (see “Performing API Tracing”). When setting this environment
variable, you can specify tracing to be active or inactive when the
application starts. You can then activate it or deactivate it from within
the application as required.
Step 2. Control the tracing (that is, enable or disable tracing) within the
program by using the CSV DEFINE_TRACE verb (for more information,
refer to the HP-UX SNAplus2 CSV Programmers Guide).
An alternative method to control HLLAPI tracing is to use the TRON
and TROFF options of the Set Session Parameters function. Refer to
the HP-UX SNAplus2/TN3270 HLLAPI Programmers Guide for more
information.
Disabling the Application's Control of Tracing
The SNACTL environment variable overrides the ability of application
programs to control API tracing. You can use SNACTL to force the tracing
of an entire application program that normally turns off tracing for some
functions or to prevent tracing for an application program that normally
uses it. When SNACTL is set before the application program is started,
any trace control commands issued by application programs are ignored.
If tracing is on, it remains on; if tracing is off, it remains off. However,
the return code from any issued trace control command indicates
successful completion.
To use SNACTL, set it to any string (such as export SNACTL=1). To cancel
SNACTL, set it to a null string.