21.02.2013 Views

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9.5.2 Starting a trace<br />

9.5.3 Trace reports<br />

A trace can be started in background mode or interactive mode.<br />

The usual way to perform a trace is in the background using the -a flag. An<br />

ampersand (&) is not necessary at the end of the command, as the trace<br />

command will spawn the trace daemon and return to the shell prompt<br />

immediately. The trace is stopped using the trcstop command.<br />

To perform a trace in interactive mode, invoke the trace command with a list of<br />

events you want to monitor and the name of the trace log output file. The events<br />

are assigned numbers that are called trace hooks.<br />

A typical command sequence may be as follows:<br />

# trace -a -j 15b<br />

# myprogram<br />

# trcstop<br />

This example traces only the open operating system that is made on the system.<br />

Trace uses in-memory buffers to save the trace data. There are three methods of<br />

using the trace buffers:<br />

Alternate mode This is the default mode. All trace events will be recorded<br />

in the trace log file.<br />

Circular mode The trace events wrap within the in-memory buffers and<br />

are not captured in the trace log file until the trace data<br />

collection is stopped.<br />

Single mode The collection of trace events stops when the in-memory<br />

trace buffer fills up and the contents of the buffer are<br />

captured in the trace log file.<br />

The binary /var/adm/ras/trcfile trace file contains all system events collected<br />

during the trace period. To obtain a readable format, this file needs to be<br />

translated using the trcrpt command, which generates an output report.<br />

To write a formatted trace report to the /tmp/trace.out file, run the following<br />

command:<br />

# trcrpt -o /tmp/trace.out<br />

The output of the trace report file is usually very large, depending on the trace<br />

parameters and the system activity. Despite selecting a narrow time period for<br />

Chapter 9. System access and printer problem determination 213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!