Turning GTF on and Specifying Options

Restriction: This topic applies to Windows environments only.

To turn on the Generalized Trace Facility, set the environment variable GTFFILE to the absolute path and file name of the trace file. You set this environment variable in the %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\bin\MF370ctl.cfg configuration file.

You can specify the following GTF options after the GTFFILE environment variable:

GTFIMIN
The instruction count at which to start the trace (default 00000000)
GTFIMAX
The instruction count at which to end the trace (default FFFFFFFF)
GTFAMIN
The instruction address at which to start the trace (default 00000000)
GTFAMAX
The instruction address at which to end the trace (default FFFFFFFF)
GTFOPT
The level of detail. You can set this environment variable to one or more of the following three-character codes separated by commas to indicate the level of detail you want: INS Trace each instruction

BAL Trace each BALR, BASR, and BASSM instruction

SVC Trace each SVC instruction

PGM Trace each LOAD, DELETE, and LINK

FOC Trace each file OPEN and CLOSE operation

FIO Trace each file input and output operation, as well as each OPEN and CLOSE

MEM Trace GETMAIN, FREEMAIN, and STORAGE

ALL All of the above trace options

REG Trace the 16 general-purpose registers at each trace event

The default value is BAL, PGM, FOC

The size of a trace file depends on the options that you specify. It can be very large. For this reason we recommend that you always begin by running a trace with the default options to find out the optimum starting point for a detailed trace. When you run a detailed trace, using options such as FIO, INS or ALL, specify the start and end points using the GTFIMIN and GTFIMAX or the GTFAMIN and GTFAMAX options.

You can also specify the REG option with any other option if you want the contents of the 16 general-purpose registers at each trace point. This increases the size of the trace file by a factor of 3 and makes it a little more difficult to read, so only use this option if you really need it. The contents of the registers are shown as they were just before the trace operation; hence the REG option is most useful with the following options:

Regardless of the trace options you have specified, whenever a program interruption occurs, the trace file contains extra lines for the instruction causing the interruption. These lines show the program status word (PSW), which contains the interruption code in the low-order byte of the first word, and the registers.