Technical data
2.2.1 Detached Tracing
In detached tracing, trace records are collected from one or more tracepoints into
an internal CTF buffer, and are then written to a trace file. Note that the trace
records in a trace file have not been analyzed; they are still in binary format, and
are therefore unsuitable for display or printing. You can use CTF commands to
analyze and display the contents of a trace file.
Detached tracing is so called because a separate process called the trace server
process is created to collect the trace records from tracepoints and write them to
the trace file.
You should use detached tracing:
• If you have a large quantity of trace records to collect
• If you will be tracing for long periods
• If you want to save trace records and examine them at a later date
An advantage of detached tracing is that you can exit from CTF but leave the
trace server process running, thus freeing your terminal for other tasks while
trace records are still being collected.
2.2.2 Live Tracing
In live tracing, trace records are collected into an internal CTF buffer and are
immediately analyzed and displayed on your terminal.
You should use live tracing only when you have a small amount of trace data to
collect and you do not wish to keep the trace data for later analysis. It is also
helpful if you can anticipate roughly when the trace records you are interested in
will be generated; this will reduce the amount of trace output that you need to
collect before finding the particular trace records you are interested in.
Due to the difference in speed between the file output performed by detached
tracing and the screen output performed by live tracing, it is possible that you
will lose trace records when live tracing if they are generated faster than they
can be collected and displayed. CTF will inform you if trace records are being
lost. If this happens, you should consider using detached tracing instead.
2.2.3 Snapshot Tracing
In snapshot tracing, trace records are collected from one or more tracepoints into
an internal CTF buffer, as in the case of detached and live tracing. However,
unlike detached and live tracing the collected trace records are neither written to
a trace file nor displayed on your terminal. The CTF buffer simply holds the trace
records as they are collected. When the buffer becomes full, new trace records
overwrite the oldest trace records in the buffer. The CTF buffer is therefore a
circular buffer whose contents represent a ‘‘snapshot’’ of the most recent history
of tracing.
At any point during snapshot tracing you can issue a CTF command that will
either:
• Write the current contents of the buffer to a trace file (if you are performing
detached tracing). You can then analyze the contents of the trace file as you
would for a trace file that had been produced by detached tracing.
• Display the contents of the buffer on your terminal (if you are performing live
tracing).
Technical Overview 2–3










