man pages section 1M: System Administration Commands

Exit Print View

Updated: July 2014
 
 

ttrace(1M)

Name

ttrace - Administer trap tracing from the hypervisor layer

Synopsis

ttrace
ttrace config -H
ttrace config -H [
-b bufsz [k | m] ]
ttrace enable -H
ttrace enable -H [
-p processor_id ...]
ttrace disable -H
ttrace disable -H [
-p processor_id ...]
ttrace suspend -H
ttrace resume -H
ttrace dump -H [
-t] [-o output] [-p 
processor_id ...]

Description

The ttrace utility is used to administer hypervisor level trap tracing. Privileged users can enable and disable tracing dynamically on demand, and configure the trace as needed.

ttrace without arguments displays the usage information.

Options

The following options are supported:

–H

Applies the command to hypervisor trap tracing on sun4v platform.

–b bufsz [k | m]

Sets the trace buffer size bufsz for all the CPUs in the system. The buffer size bufsz can include either of the suffixes k or m. By default, bufsz is 2 * PAGESIZE. If the buffer with the desired size is allocated, trap trace reconfiguration will also occur, with the new buffer replacing the old one. The upper limit size for HV trace buffer is 16M.

However, if the desired buffer cannot be allocated at the moment due to a lack of memory, ttrace will continue to use the previously allocated buffer. As a result, the actual bufsz on a particular CPU might be different from the global bufsz.

Trap trace reconfiguration is expensive, so it is not recommended to use this option too often on production machines.

–p processor_id processor_id ...

Lists the CPUs on which the actions apply. The sub-commands which can accept this option are enable, disable, and dump.

–o output

Sets the output file when dumping trace records. If this option is omitted, the default output is stdout.

–t

Walks trace records across all CPUs in the order of time stamps. If this option is omitted, the trace records will be walked first by CPU.

Sub Commands

The following subcommands are supported:

enable

Enables trap tracing on a list of CPUs. If no CPU is specified through the –p option, then the traces will be enabled on all CPUs.

disable

Disables trap tracing on a list of CPUs. If no CPU is specified through the –p option, then all the traces will be disabled.

suspend

Suspends trap trace on all CPUs. A CPU that has tracing disabled may be suspended; when resumed it will still be disabled. The subcommands suspend and resume generate less overhead than the subcommands disable and enable. If you wish to stop tracing on all CPUs temporarily, you should use suspend and resume.

resume

Restores the traces on all CPUs to the status prior to the suspend. suspend and resume operate on all CPUs.

config

Displays the trap trace status for all CPUs, without an option. If specified with option, –b bufsz, the trace buffer size will be set to the specified bufsz, and result in trap trace reconfiguration.

dump

Dumps trace records. Without any options, all trace records will be displayed on the terminal. If an output file and a list of CPUs are provided, only the traces from these CPUs will be dumped out to the specified output file.

The format of the output is subject to change in the future.

TRAP TRACE STATUS

TRAP TRACE STATUS

The CPU supports the following trap trace statuses.

Ready

The trace buffer has been allocated therefore the trace is ready to be enabled.

Config

The trace buffer has been allocated and configured but not enabled. Therefore, the trace is ready to be enabled.

Enabled

The trap trace has been enabled, therefore the contents in the trace buffer is being updated with the trap activities on the CPU.

Disabled

The trap trace has been disabled. So the contents in the trace buffer will not be updated until re-enabled. The trap activities occurred between the status Disabled and Enabled will not be reflected in the trace buffer.

Suspended

The trace has been suspended on all CPUs.

Exit Status

The following exit values are returned:

0

Successful completion.

1

An error occurred.

Examples

Example 1 Displaying the Current Trap Trace Status on Each CPU and its Buffer Size

The following example shows how to display the current trap trace status on each CPU and its buffer size, by using the config subcommand:


# ttrace config -H
HV trap trace status :
CPU     Trace-Status      buffer             size
0       Ready             0x22e70000         32768
1       Ready             0x22950000         32768
2       Ready             0x22958000         32768
3       Ready             0x22960000         32768
Example 2 Setting the Trace Buffer Size

The following example shows how to set the trace buffer size by using the config subcommand with the –b <bufsz> option:


# ttrace config -H -b 64k
HV ttrace buffer size has been set to 65536 and recofigured
successfully. HV trap trace is ready to be enabled.
Example 3 Enabling Traces on all CPUs

The following example show how to enable traces on all CPUs by using the enable subcommand:


# ttrace enable -H
# ttrace config -H
CPU     Trace-Status      buffer             size 
0       Enabled           0x22d30000         65536
1       Enabled           0x22d40000         65536
2       Enabled           0x22e70000         65536
3       Enabled           0x22950000         65536

The subcommand enable with option –p followed by a list of CPUs will enable the trace on the list of CPUs only if they are currently disabled.

Example 4 Disabling Traces on all CPUs

The following example shows how to disable the traces on all CPUs by using the disable subcommand without –p option. If –p option is provided, only traces on the list of CPUs will be disabled.


# ttrace disable -H -p 2 3

# ttrace config -H
CPU     Trace-Status       buffer             size 
0       Enabled            0x22d30000         65536
1       Enabled            0x22d40000         65536
2       Disabled           0x22e70000         65536
3       Disabled           0x22950000         65536

Example 5 Suspending Trap Traces on all CPUs

The following example shows how to suspend trap traces on all CPUs:

# ttrace suspend -H
Example 6 Resuming Trap Traces on all CPUs

The following example shows how to resume trap traces on all CPUs. suspend and resume are more efficient than disable and enable:

# ttrace resume -H
Example 7 Displaying Trace Records

The following example shows how to display trace records. Without arguments, all the trace records will be displayed on the terminal. If –o option is presented followed by an output file, the records will be saved to the output file. If –p option is presented followed by a list of CPUs, only the records from these CPUs will be saved.

# ttrace dump -H -o trace.out -p 2 3

With –t option, the trace records will be saved across CPUs in the order of the time stamps, instead of CPU by CPU:

# ttrace dump -H -t -o alltrace.out

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/kernel/ttrace
Interface Stability
Committed

See also

attributes(5)