Dynamic Trace Customizer (TRCUST)
OS/2 provides a mechanism by which developers may dynamically apply tracepoints
in their module at run time. This method eliminates all overhead of tracing
when tracing is disabled. It also allows the developer to add tracepoints
without modifying source code. This reduces the possibility that adding
a tracepoint will induce errors into one's code. OS/2 needs a binary file,
for each module being dynamically traced, which defines the tracepoints
for the module.
There are certain restrictions on the use of dynamic trace which should
be noted. These are:
- Executable (.EXE) programs running in processes other
than the trace command cannot have dynamic tracepoints applied.
- A dynamic tracepoint cannot be applied to a module
running under the Kernel Debugger that has a Breakpoint in place at the
same location as the trace point.
- The trace command is unable to apply dynamic tracepoints
to any module for whom DosLoadModule is not applicable. This precludes the
following:
- Physical Device Drivers
- Virtual Device Drivers
- File System Device Drivers
The
DTRACE utility (shipped with the IBM Developer Connection and OS/2 Warp
4) provides a means of overcoming this particular restriction.
The Trace Customizer (TRCUST) converts tracepoint definitions from a trace
source file (TSF) into dynamic tracepoints for the trace definition file
(TDF), and into formatting rules in the trace format file (TFF).
Definitions
TSF
An ASCII file created by a developer which
defines all dynamic tracepoints for a given module. TRCUST currently allows
at most only one major code per TSF.
.TDF
A
binary file, created by TRCUST, using the .TSF file as input. This
file defines all tracepoints in the module in a manner acceptable to OS/2.
This is used by the Trace Utility, TRACE.
.TFF
A
binary file also created by TRCUST using the .TSF file. This file
defines how all tracepoints will be formatted. This is used by the Trace
Formatter, TRACEFMT.
major code
A
byte value used to identify the module being traced. TRCUST allows at most
only one major code per TSF.
minor code
A
word value used to uniquely identify each tracepoint.
GROUP
A value used to identify this tracepoint with tracepoints
of the same category. Examples are MEM for memory management and PM for
Presentation Manager. For an example of uses of groups, see the online help
for the TRACE command.
TYPE
A
value used to associate a subset of dynamic trace events within a module.
Examples are PRE for pre-invocation, POST for post-invocation and API for
API calls within a module. For an explanation and examples of uses of types,
see the online help for the trace command.
[Back: WINDOWTEMPLATE Statement]
[Next: File Naming and Location]