ktracer.1m (2010 09)

k
ktracer(1M) ktracer(1M)
-f Free the memory allocated by
ktracer, namely the per-CPU trace buffers and the function
list. After completing a session of kernel tracing and CR ktracedump report generation, invok-
ing
-f is recommended, particularly if not much physical memory is available on the system.
General Interest
-? Print the
ktracer usage message. Describe the options of the ktracer command briefly.
-t Print current status of
ktracer.
The internal state of kernel tracing includes the following information:
1. The allocated size and content of the trace buffers.
2. The selected functions to trace (see Changing the Function List ).
3. Any inserted trace points (see Installing the Function List ).
4. Whether trace collection is on or off (see Getting Started ).
The output of
ktracer -t lists four status elements separated by semicolons. Sample
status:
ON; Trace ACTIVE; Funcs INSTALLED; ALLOCATED;
The first status element is either ON or OFF.
ktracer is turned ON explicitly by -b or -B
,
or implicitly by
-L or -R. ktracer is turned OFF explicitly by -h
, or implicitly by -a, -A,
-r, -S, -U, -z,or-Z.
ktracer can also be turned off when a STOP function is executed.
See
-S.
The second status element is either "Trace ACTIVE" or "Trace NOT active", which means the
same thing respectively as ON or OFF, the first status element.
The third status element is either "Funcs INSTALLED" or "Funcs NOT installed". The status
becomes "Funcs INSTALLED" when trace points for functions are installed explicitly by com-
mand line option
-I, or implicitly by -b, -B, -L
,or-R.
The third status element becomes "Funcs NOT installed" when trace points for functions are
removed (uninstalled). Trace point removal occurs explicitly by command line option
-U,or
implicitly by
-a, -h, -r, -S, -z,or
-Z.
The fourth status element is either "ALLOCATED" or "NOT allocated". Memory is allocated
explicitly by command line option
-A or implicitly by -L or -R. Memory is freed explicitly by
-f.
As just described, the status of
ktracer can change implicitly. These implicit changes cause
ktracer to behave differently than an unfamiliar user expects. See WARNINGS for further
information.
-p pid Trace only the specified PID (0 for all).
The
-p option selects the specified process ID (PID) to trace. If the PID is nonzero, all other
PIDs on the system will not be traced. Sample usage would be ktracer -Z -p 1234 -R
to trace all the kernel function calls that PID 1234 makes.
-D ktracedump-options
Pass ktracedump-options through to the ktracedump program. See ktracedump (1M) for
more information.
Two
ktracer options, -g interval and -w workload, automatically invoke ktracedump.
ktracedump-options is a string of
ktracedump options which is passed along from ktracer
to ktracedump as command-line arguments. If the string has any whitespace, it must be
quoted. Because ktracer executes command-line options in order, note that -D must pre-
cede -w or -g on the ktracer command line. For example, the following -D option will
instruct ktracedump to list traced functions (-F), add Caller as an output field (-J
Caller), and sort the traces by timestamp (-S AbsSec):
# ktracer -D "-F -J Caller -S AbsSec" -w workload > ktd.wkld
The following command causes ktracedump to not execute when the 4-second interval
expires:
# ktracer -D "-? > /dev/null" -g 4 > ktd.interval
HP-UX 11i Version 3: September 2010 9 Hewlett-Packard Company 9