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

Performance Management Guide

Starting and Controlling Trace from the Command Line

The trace facility is configured and data collection optionally started by the trace command, the detailed syntax of which is described in the AIX 5L Version 5.2 Commands Reference.

After trace is configured by the trace command, there are controls to turn data collection on and off and to stop the trace facility (the trcstop subcommand deconfigures trace and unpins buffers). You can invoke the controls through: subcommands, commands, and subroutines. The subroutine interfaces are described in Starting and Controlling Trace from a Program.

Controlling Trace in Subcommand Mode

If the trace routine is configured without the -a option, it runs in subcommand mode. Instead of the normal shell prompt, a prompt of "->" displays. In this mode, the following subcommands are recognized:

trcon
Starts or resumes collection of event data
trcoff
Suspends collection of event data
q or quit
Stops collection of event data and terminates the trace routine
!command
Runs the specified shell command
?
Displays the available commands

For example:

# trace -f -m "Trace of events during mycmd"
-> !mycmd
-> q
#

Controlling Trace by Commands

If the trace routine is configured to run asynchronously (trace -a), trace can be controlled by the following commands:

trcon
Starts or resumes collection of event data
trcoff
Suspends collection of event data
trcstop
Stops collection of event data and terminates the trace routine

For example:

# trace -a -n -L 2000000 -T 1000000 -d -o trace.out
# trcon
# cp /a20kfile /b
# trcstop

By specifying the -d (defer tracing until the trcon subcommand is entered) option, you can limit how much tracing is done on the trace command itself. If the -d option is not specified, then tracing begins immediately and can log events for the trace command initializing its own memory buffers. Typically, we want to trace everything but the trace command itself.

By default, the kernel buffer size (-T option) can be at most one half of the log buffer size (-L option). If you use the -f flag, the buffer sizes can be the same.

The -n option is useful if there are kernel extension system calls that need to be traced.

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