ktracer.1m (2010 09)
k
ktracer(1M) ktracer(1M)
Certain functions known to ktracer are excluded because tracing their execution is potentially
problematic.
These
ktracer add failures are based on the function characteristics, and do not vary based on which
add option is used: -a, -e
, -l, -m,or-S.
When a request is made to add an untraceable function to list, the outcome is that an error message will
be reported, and the requested function will not be added and will not be traced when it executes.
In terms of
ktracedump output, none of the trace records will have the untraceable function name in
the "Function" column, because that function was not traced as it executed. It is possible for untraceable
functions to call traceable functions. In this case the untraceable function would be seen in the "Caller"
column, just never in the "Function" column.
As long as at least one traceable function is added successfully to the traced function list, these diagnostic
messages will not prevent
ktracer from continuing on to trace the functions it can.
EXAMPLES
A simple way to collect a kernel trace on a live system:
# ktracer -R (Turn on tracing of everything possible)
# workload (Run the application(s) to be traced)
# ktracer -h (Halt tracing)
# ktracedump -D > ktrace.all (Produce trace report)
How to report a trace listing on a dump:
#cddump_directory
# ktracedump -m > ktrace.dump
How to trace only calls to read and write, and capture 30,000 calls per CPU:
# ktracer -z -Z -A 30000 -a read -a write -B
# workload (Run the application(s) to be traced)
# ktracer -h (Halt tracing)
# ktracedump -D > ktrace.rw (Produce trace report)
If you have a lot of
ktracer options such as a long list of function names to add, you can put them in a
file as follows:
# echo "-z -Z -A 10000 -a fn1 -a fn2 -a fn3 -a fn4 -B" > kt.opt
and invoke ktracer using the option file:
# ktracer $(<kt.opt)
Invoking ktracer once with a list of function names, as shown above, is much faster than invoking
ktracer repeatedly with one -a func at a time.
Here is an example of how to select all functions in the kernel that contain
lock in their name, and start
tracing them:
# ktracer $(nm -pxv /stand/vmunix | egrep "lock" | \
> awk ’{print "-a " $3}’) -B
WARNINGS
HP supports the use of ktracer through HP Caliper 5.0 on HP-UX 11i v3 Update 3 and later only.
Among the most common errors reported is that
ktracer is not collecting trace records after the user
issues a sequence of module (-m) or function additions (-a). If you think that ktracer seems to not be
tracing, use ktracer -t to check the status. Likely the status is:
OFF; Trace NOT active; Funcs NOT installed; ALLOCATED;
The remedy is to issue the -b option to turn tracing ON after the final -m module or -a function is
issued.
To understand when
ktracer changes state implicitly, read the Tracing Status section. In particular,
when a user requests to modify the function list or the trace buffer allocation, ktracer automatically
switches to the state "OFF" and "Funcs NOT installed". ktracer does not automatically install and
begin every time a new function or module is added to the function list, but rather ktracer waits until
instructed to begin.
HP-UX 11i Version 3: September 2010 − 11 − Hewlett-Packard Company 11