Controlling Internal Tracing

The compiler option NOTRC defines whether internal tracing is included in object code. Compiling with /DNOTRC does not include internal tracing (the TRACEn macros expand to a no-op); compiling without /DNOTRC includes internal tracing.

Note The registry entries used to control tracing are inserted by the Setup program. The SNATRACE.EXE program can be used to enable or disable internal tracing dynamically at run time (assuming binaries have been compiled with internal tracing enabled).

When running an executable program that was compiled with internal tracing, tracing is enabled by generating the following entries in the Microsoft® Windows NT® registry:

InternalTraceLevel=n
InternalTraceFile1=file1
InternalTraceFile2=file2

FlipLength=Length_in_Bytes

The entries should be stored under:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
\<SNALink name>\Parameters

The value n is the severity level of the tracing required. All trace calls at this level or higher are included in the trace output; trace calls at lower levels are ignored. For example, setting level 10 includes all trace calls at levels 10, 12, and 16, but excludes tracing at levels 2, 4, 6, and 8. Use 0 to include all tracing at whatever level, or 20 to disable tracing entirely.

The parameters file1 and file2 are the names of files to which trace output is written. If two file names are specified, trace output is sent to the first file until it reaches FlipLength bytes and then is sent to the second file; when the second file also reaches FlipLength bytes, the first file is cleared and tracing continues to the first file. This process continues, changing to the other file every time the current file reaches FlipLength bytes, so that only the most recent FlipLength bytes of trace information is retained. If only one file name is specified, FlipLength is disregarded and tracing continues to this file regardless of file size.