The Execution Tracing Package
Introducing the Execution Tracing Package
Software developers know that writing code is relatively easy. Getting it to run properly and perform as expected is the hard part. Testing and debugging are a significant part of the total development time of any project, and much of that time is spent inserting and removing temporary output statements. Before the software is released, these statements are removed, commented out, or conditionally compiled out, so they do not degrade the performance of the executable. These approaches to debugging, although widely used, are extremely inefficient. Whenever the temporary tracing statements are toggled on or off, the application must be recompiled and re-linked. This problem becomes more serious as the application increases in size.
The Threads Module Execution Tracing package generates a record of program execution. With the simple event logging interface, you can trace your applications in a way that is similar to the standard approaches, but more efficient and cost effective.
The Execution Tracing package (Trace) provides the following features:
Trace enables you to output arbitrary informational messages, including an object’s state, to any
ostream.
Trace statements automatically output the name of the file containing the executing code, the line number within that file, and the address of the object, if a member function is being traced.
Trace can connect to other products for special-purpose output handling, such as storing output in a database or sending output over a network.
Trace gives you flexibility and control over the type and amount of information produced. Every trace statement has a severity level associated with it. At compile-time you decide the maximum level of tracing to compile into your application. At runtime you can filter the data further with environment variables.
Trace enables you to select at runtime the specific functions that you want tracing output from. You can also select all the functions in a particular class or package, and selectively turn off tracing for functions you’re not interested in tracing.
Trace provides a runtime filter that you can compile into your application to dynamically control the level of tracing messages that your application generates.
Trace overhead can be removed entirely by recompiling your application after testing and debugging are complete.