trace subcommand

The trace subcommand displays data in the system trace buffers.

Format

trace [-h ] [ -c channel ] [ hook [:subhook ] ]... [ #data ]... [ -t TID ] [ -v ]

Flags

Item Description
-c channel Selects the trace channel for which the contents are to be monitored. The value for channel must be a decimal constant in the range 0 to 7. If no channel is specified, a prompt is displayed.
-h Displays trace headers.
-j event_list Specifies user-defined events for which you want to collect trace data. You must separate multiple hook IDs with blank spaces. For AIX 6.1 and later releases, entering a 2-digit hook ID of the form hh specifies hh00,hh10,...,hhF0. Entering a 3-digit hook ID of the form hhh specifies hhh0. Entering a 4-digit hook ID of the form hhhh specifies hhhh.
-k event_list Specifies user-defined events for which you want to exclude trace data. You must separate multiple hook IDs with blank spaces. For AIX 6.1 and later releases, entering a 2-digit hook ID of the form hh specifies hh00,hh10,...,hhF0. Entering a 3-digit hook ID of the form hhh specifies hhh0. Entering a 4-digit hook ID of the form hhhh specifies hhhh
-t TID Specifies thread ID filter. A thread is identified by its thread ID in hex format. When the trace command is used to display buffer contents, this parameter is used to display only events related to the specified thread. Otherwise, this parameter is not valid. This parameter can be used when both system and KDB kernel debugger trace buffers are displayed.
-v Displays events using a verbose output format. This parameter can be used when both system and KDB kernel debugger trace buffers are displayed.

Parameters

Item Description
data Selects only those trace entries with the specified data word. For instance, specifying #AA displays all trace entries where at least one data word is recorded as 0xAA.
hook Specifies user-defined events for which you want to collect trace data. You must separate multiple hook IDs with blank spaces. For AIX 6.1 and later, entering a 2-digit hook ID of the form hh specifies hh00, hh10,...,hhF0. Entering a 3-digit hook ID of the form hhh specifies hhh0. Entering a 4-digit hook ID of the form hhhh specifies hhhh.
:subhook Specifies subhooks, if needed. The subhooks are specified as hexadecimal values.
Note: If subhooks are used, the complete syntax must include both the hook and subhook IDs as a pair separated by a colon. For example, assume the trace hook is 1d1 and the subhook is 2d. The hook specification would look like 1d1:2d. Separate multiple hook and subhook pairs with a space.

To display the user-initiated system trace buffers, specify the channel (-c). Data is entered into the system trace buffers using the trace shell subcommand. If the shell subcommand was not invoked prior to using the trace subcommand, the system trace buffers are empty. When buffered entries are displayed, they are shown in reverse order (most recent first).

The default trace entry output format is a simplified and short view of the trace record. To view trace entries in a more verbose format, use the -v parameter.

The trace subcommand is not meant to replace the shell trcrpt subcommand, which formats the data in more detail. The trace subcommand is a facility for viewing system trace data from KDB kernel debugger or kdb command on a dump. The trcdead and trcrpt shell subcommands are useful in working with trace buffers contained in a system dump.

Other

No aliases.

Examples

The following example dumps the event buffer on channel 2, related to Thread ID 14539 for an active system trace (the trace is not initiated by KDB kernel debugger):

KDB(0)> trace -c 2 -t 14539