Dynamic Versus Static Trace

OS/2 supports two types of tracepoints:

Both types of tracepoints can be used to monitor the execution of a software module. They differ in their style of execution.

Static tracepoints are, essentially, in-line function calls that are always present. The OS/2 user has the ability (through the use of the OS/2 TRACE utility) to indicate that a particular static tracepoint is "enabled". Until a static tracepoint is enabled, the actual tracepoint logic logic is "branched over" and not executed. Once "enabled" the static tracepoint logic is executed.

Dynamic tracepoints do not normally reside within the software modules to which they correspond. They are "patched in" when the OS/2 user uses the TRACE utility to "enable" a dynamic tracepoint.

This implies that a dynamic tracepoint does not burden a software module with any execution overhead until the tracepoint is "patched in" by the TRACE utility. There is a small continual performance overhead associated with a static tracepoint because the tracepoint must always check to see whether it is currently enabled. On the other hand, the dynamic tracepoint mechanism is costlier in operation than the staic tracepoint operation because its "patching" mechanism is built upon the OS/2 breakpoint mechanism. Also, there are some software modules (for example, device drivers) that cannot use dynamic tracepoints. Most of the operating system tracepoints listed in the Trace Reference are implemented as dynamic tracepoints.

All Trace event records include a major trace code and a minor trace code which identify the event which is being recorded. When the user uses The TRACE utility to control a specific tracepoint, static tracepoints are identified by a combination of major and minor trace codes. Dynamic tracepoints are identified by a combination of software module name and minor trace code.

The following general categories of events are traced within OS/2:


[Back: System Trace Facility - User Guide]
[Next: Guidelines for Defining Tracepoints]