[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Performance Management Guide


Using the trcrpt Command to Format a Report

The trace report facility reads the trace log file, formats the trace entries, and writes a report. The trcrpt command displays text and data for each event according to rules provided in the trace format file (/etc/trcfmt). Stanzas in the format file provide formatting rules for events or hooks. Users adding hooks to programs can insert corresponding event stanzas in the format file to print their trace data (see Adding New Trace Events).

The trcrpt facility does not produce any summary reports, but you can use the awk command to create simple summaries through further processing of the trcrpt output.

The detailed syntax of the trcrpt command is described in the AIX 5L Version 5.1 Commands Reference.

Formatting a Report on the Same System

The trcrpt command formats reports of trace event data contained in the trace log file. You can specify the events to be included (or omitted) in the report, as well as determine the presentation of the output with this command.

You can use the System Management Interface Tool (SMIT) to run the trcrpt command by typing the SMIT fast path:

# smitty trcrpt

To create a trace report to the newfile file, type:

# trcrpt -o newfile

Formatting a Report on a Different System

It is often desirable to run the trcrpt command on another system than the system where the trace is collected. There may be various reasons for this, such as:

You can run the trace command on a system and run the trcrpt command on that trace file on a different system. In order for this to work correctly, the output of the trcnm command is needed from the system where the trace was run. Run the trcnm command and redirect the output into a file, as follows:

# trcnm > trace.nm

If you want to use the trace file for other performance tools such as tprof, pprof, netpmon, and filemon, run the gennames Ggennames_File command.

That file is then used with the -n flag of the trcrpt command, as follows:

# trcrpt -n trace.nm -o newfile

If -n is not specified, then the trcrpt command generates a symbol table from the system on which the trcrpt command is run.

Additionally, a copy of the /etc/trcfmt file from the system being traced might be beneficial bacause that system may have different or more trace format stanzas than the system where the trcrpt command is being run. The trcrpt command can use the -t flag to specify the trace format file (by default it uses the /etc/trcfmt file from the system where the trcrpt command is being run). For example:

# trcrpt -n trace.nm -t trcfmt_file -o newfile

Formatting a Report from trace -C Output

If trace was run with the -C flag, one or more trace output files are generated. For example, if the trace file name was specified as trace.out and -C all was specified on a 4-way SMP, then a trace.out, trace.out-1, trace.out-2, trace.out-3, and trace.out-4 file was generated. When you run the trcrpt command, specify trcrpt -C all and trace.out as the file name, and all the files will be read, as follows:

# trcrpt -C all -r trace.out > trace.tr

This trace.tr file can then be used as input for other commands (it will include the trace data from each CPU). The reason for the -C flag on trace is so that the trace can keep up with each CPU's activities on those systems which have many CPUs (more than 12, for example). Another reason is that the buffer size for the trace buffers is per CPU when you use the -C all flag.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]