TRACE and TRACE Processing

The trace command is used to control the system trace.

      Command line:                        CONFIG.SYS:

      TRACE ON                             TRACE=ON
      TRACE OFF                            TRACE=OFF
(you can specify only static TRACE in the CONFIG.SYS file).

The above is optionally followed by one or more major code specifications, or one or more trace definition file specifications, or keywords. Next, you may optionally specify one or more process identifiers. Finally, you may specify that the trace buffer be cleared, and that trace activity be suspended, or resumed.

OS/2 processes TRACE statements in the order in which they appear from any source. TRACE commands in CONFIG.SYS are processed in the order they appear. The effects of the statements are cumulative for the duration of OS/2's execution. If any part of a statement is incorrect, OS/2 ignores the statement.

Process Id is specified by /P:nn,nn,nn (where nn is in HEX!)

Clearing the trace buffer is specified by using /C.

Resuming trace activity is specified by using /R.

Suspending trace activity is specified by using /S.

Major and minor event codes are associated with all trace events. Some of the major codes follow:

Machine Exceptions Major Code: 3

Hardware Interrupts Major Code: 4

Device Helper Routines Major Code: 6

Disk Device Driver Major Code: 7

Major codes may be specified by listing them separated by commas, or as a range, for example, 2-7 specifies codes 2,3,4,5,6,7. Both methods may be combined, as in 5,7,12-18,2,27-32,9 .

If you do not specify TRACE in CONFIG.SYS, event tracing is not started by CONFIG.SYS processing, but may be started later if TRACEBUF has been specified.

Records in the buffer are identified by major and minor codes. Some of the data that may be recorded in the circular buffer includes system events such as interrupts, exceptions, and thread switches.

OS/2 contains a mixture of static tracepoints and dynamic tracepoints.

Static tracepoints are implemented as trace function calls within individual software modules. The TRACE command can be used to turn on and off static tracepoints by specifying them by major code and, optionally, by minor code.

Dynamic tracepoints are implemented by implanting an INT 3 instruction at the specified location, and gathering data when the interrupt occurs. The TRACE command can be used to turn on and off dynmaic tracepoints, but only by specifying the module or trace definition file name as a parameterr. Dynamic tracepoints cannot be turnned on and off by reference to their major codes.


[Back: TRACEBUF and TRACEFMT]
[Next: TRACEFMT Processing]