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 ...]
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.
The following options are supported:
Applies the command to hypervisor trap tracing on sun4v platform.
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.
Lists the CPUs on which the actions apply. The sub-commands which can accept this option are enable, disable, and dump.
Sets the output file when dumping trace records. If this option is omitted, the default output is stdout.
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.
The following subcommands are supported:
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.
Disables trap tracing on a list of CPUs. If no CPU is specified through the –p option, then all the traces will be disabled.
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.
Restores the traces on all CPUs to the status prior to the suspend. suspend and resume operate on all CPUs.
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.
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.
The CPU supports the following trap trace statuses.
The trace buffer has been allocated therefore the trace is ready to be enabled.
The trace buffer has been allocated and configured but not enabled. Therefore, the trace is ready to be enabled.
The trap trace has been enabled, therefore the contents in the trace buffer is being updated with the trap activities on the CPU.
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.
The trace has been suspended on all CPUs.
The following exit values are returned:
Successful completion.
An error occurred.
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 32768Example 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 CPUsThe 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 65536Example 5 Suspending Trap Traces on all CPUs
The following example shows how to suspend trap traces on all CPUs:
# ttrace suspend -HExample 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 -HExample 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
See attributes(5) for descriptions of the following attributes:
|