Bracketing Data Collection

Trace data accumulates rapidly. Bracket the data collection as closely around the area of interest as possible.

One technique for doing this is to issue several commands on the same command line. For example, the command


trace -a; cp /etc/trcfmt /tmp/junk; trcstop
The following command captures the total copy command run, and stops the trace when the command finishes:

trace -ax "cp /etc/trcfmt /tmp/junk"

captures the total execution of the copy command.

Note: This example is more educational if the source file is not already cached in system memory. The trcfmt file can be in memory if you have been modifying it or producing trace reports. In that case, choose as the source file some other file that is 50 to 100 KB and has not been touched.