ktracedump.1m (2010 09)
k
ktracedump(1M) ktracedump(1M)
proceed to display the traced function list section if
-F is specified.
# ktracedump -D -N -F
will report the ktracedump header and the traced function list, and
no trace records.
-F Display the traced function list. List the name of every kernel function that the
ktracer user has
selected to trace.
It is common and expected, particularly with
ktracer -R
, to see many functions on the traced
function list that have not been traced
. To clarify, the traced function list is the
full set of kernel functions that the
ktracer
user has selected to be traced whenever executed.
Whether or not these selected functions have corresponding trace records due to their recent execu-
tion has no bearing upon their presence on this function list.
# ktracedump -DNF displays the function list on a live system.
# ktracedump -mNF displays the list of functions that
ktracer had installed at the time the
dump was captured.
Reading Command Line Options from a File
Particularly because
ktracedump has so many command line options, it can be useful to put a long list
of command line options into a file, and direct
ktracedump to use that file. Suppose the file named
filter.opts has the content:
-D -J TID -JStkPtr
-f CPU::[0-7]
-f StkPtr::ˆ0xe0
-f TID:v:-1
To cause
ktracedump to read options from the file named filter.opts, invoke:
ktracedump $(cat filter.opts) > filt.rpt
Because of the content of filter.opts, the resulting filtered report will show only trace records from
CPUs 0 through 7, where the stack pointer begins with 0xe0, and the thread ID is not -1.
This method of passing command line options via file can be extended from the file name
filter.opts
to any valid file name. It can be extended from specific ktracedump options to general command line
options, and extended from the ktracedump command to any command. Look for file kd.opts in the
EXAMPLES section.
To apply the same command line options to every
ktracedump invocation, put them in a file named
.ktracedumprc. Every time ktracedump
is invoked, it looks for a file named .ktracedumprc in
the current directory, else in the
HOME directory. If it finds .ktracedumprc
, ktracedump will pro-
cess the command line options in that file before processing the options from the command line itself.
Timekeeping
ktracer captures timing information with sub-nanosecond granularity. The values for AbsTime and
ElTime are measured in iticks. One itick occurs each time the hardware interval timer counts up by one.
ktracedump reports the number of iticks per second and the number of nanoseconds per itick in the
output header.
On older processors, the itick rate is the inverse of the cycle speed. For example, a 1.5 GHz processor
counts 1.5 billion iticks per second, which equates to 0.667 nanoseconds per itick. The itick rate on
hyperthreaded processors and the itick rate on HP Integrity Virtual Machines may differ from the cycle
speed. Either way,
ktracedump will report the number of iticks per second and the number of
nanoseconds per itick in the output header.
Timer Synchronization
In the kernel,
ktracer captures the value of the interval timer on the current CPU immediately after
entering each traced function. Because the interval timer values may differ from one CPU to the next,
ktracer normalizes the timestamp to CPU 0 before storing it as AbsTime in the trace record on the
current CPU. This assists in comparing timestamps between different CPUs.
The values that
ktracedump reports for columns AbsSec, ElTime, and ElUSec are not stored in the
trace record, but are computed from AbsTime when ktracedump runs. For example, tracing the func-
tion per_spu_hardclock() for 5 seconds on a hyperthreaded processor reveals that each
hyperthreaded sibling (CPU) calls per_spu_hardclock() 500 times in 5 seconds. This amount is 100
times per second. The ElUSec value for each hardclock trace is very near to 10000 microseconds,
HP-UX 11i Version 3: September 2010 − 5 − Hewlett-Packard Company 5