ktracer.1m (2010 09)

k
ktracer(1M) ktracer(1M)
Halt is normally used before running ktracedump
to see the trace output.
When functions are intercepted, system performance degrades in proportion to how often
intercepted functions are called. When
ktracer stops intercepting functions, then path flow
and system performance are restored to normal.
To start
ktracer after a halt, use the
-b option.
-g #seconds
An all-in-one way to gather trace data for the specified number of seconds. The
-g option does
the following tasks:
If trace buffers are not yet allocated, allocate them (
-A), else reset trace buffers to zero
(
-Z).
Begin tracing (-b).
Sleep for #seconds .
Halt tracing (-h).
Produce a report by invoking
ktracedump.
If the
ktracer -D option was specified earlier on the command line, its argument will be
used as command line options to ktracedump.
-w workload
An all-in-one way to trace the specified workload. Workload is a generic term that is meant to
be replaced by the command line invocation of an application, executable, or script. The -w
option does the following tasks:
If trace buffers are not yet allocated, allocate them (-A), else reset trace buffers to zero
(-Z).
Begin tracing (-b).
Run the workload command.
Halt tracing (-h).
Produce a report by invoking ktracedump.
If the
ktracer -D option was specified earlier on the command line, its argument will be
used as command line options to ktracedump.
workload is an single executable command. It requires quotes if the command has multiple
arguments or whitespace. For example:
# ktracer -w ./runme
or
# ktracer -w ’/usr/bin/find / -name core’
The -w option automatically invokes
ktracedump. See the -D option in the General Interest
section for more information about
ktracedump.
Changing the Function List
Functions may be added or removed from the list only when
ktracer is in this state:
OFF; Trace NOT active; Funcs NOT installed; ALLOCATED;
When function list modifications are complete, ktracer remains in this inactive state until it is given
the request for the functions to be installed and for tracing to begin. After the last function add or remove
is specified, add a -B at the end of the command line to get tracing started.
-a func Add the specified function to the list of functions to trace.
The func argument may be the name of an individual kernel function, or it may be a numeric
kernel address specified in hexadecimal or decimal.
Multiple
-a options can be specified on a command line.
See the DIAGNOSTICS section regarding failures when adding functions.
The following example sets up
ktracer to trace the kernel functions named soconnect and
soaccept.
# ktracer -a soconnect -a soaccept
HP-UX 11i Version 3: September 2010 5 Hewlett-Packard Company 5