HP Caliper Ktrace Features Guide

Options
Table 2–1 summarizes the command line options. Details are in the ktracer(1M)
manpage. Options are executed in the order specified, meaning their order on the
command line makes a difference.
Table 2-1 ktracer options
DescriptionOption
Getting Started
Reasonable defaults: An easy way to get started tracing everything. This option
does the following tasks: clear previous tracing state, allocate trace buffers,
add all functions, insert trace points, and begin tracing.
R
Lightweight defaults: An easy way to get started tracing key functions. This
option does the following tasks: clear previous tracing state, allocate trace
buffers, add a few key functions (kernel procedures relating to system calls,
thread switching, interrupt processing, and idle), insert trace points, and begin
tracing.
L
Begin tracing. Start intercepting and tracing functions. In the following
command example, ktracer starts tracing every call that the kernel makes
to read() and write():
ktracer -a read -a write -b
b
Begin tracing. Start intercepting and tracing functions. Same as -b-B
Halt. Stop tracing and intercepting functions.
The -h option stops ktracer from collecting traces into the trace buffers,
and stops ktracer from intercepting functions. Halt is normally used before
running ktracedump to see the trace output.
-h
An all-in-one way to gather trace data for the specified number of seconds.
The g option does the following tasks: allocate trace buffers if necessary or
reset the trace buffers to zero, begin tracing, sleep for numsec, halt tracing,
produce a report by invoking ktracedump.
g numsec
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: allocate trace
buffers if necessary or reset the trace buffers to zero, begin tracing, run the
workload command or script, halt tracing, produce a report by automatically
invoking ktracedump. If workload has multiple arguments or whitespace,
it requires single quotes. For example:
ktracer w 'find' / name core'
w workload
Changing the Function List
20 ktracer: Kernel Tracer