HP Caliper Ktrace Features Guide
Table 2-1 ktracer options (continued)
DescriptionOption
Trace only the specified PID (0 for all).
Sample usage would be ktracer -Z -p 1234 -R to trace all the kernel
function calls that PID 1234 makes.
—p PID
Pass the ktracedump-options through to the ktracedump program. Two
ktracer options, -g and -w, automatically invoke ktracedump.
Because ktracer executes command line options in order, the —D option
must be specified before the —g or —w option.
—D ktracedump-options
Examples
A simple way to collect a kernel trace on a live system.
ktracer -R (Turn on tracing of everything possible)
run workload (Run the application(s) to be traced)
ktracer -h (Halt tracing)
ktracedump -D > ktrace.all (Produce basic trace report)
Report a trace listing of a (crash) dump:
cd dump_directory
ktracedump-m > ktrace.dump
Trace only calls to read and write, and capture 30000 calls per CPU:
ktracer -z -Z -A 30000 -a read -a write -B
run workload (Run the applications(s) to be traced)
ktracer -h (Halt tracing)
ktracedump-D -A > ktrace.rw (Produce trace report)
If you have many ktracer options such as along list of function names to add, you
can put them in a file:
echo "-z -Z -A 10000 -a fn1 -a fn2 -a fn3 -a fn4 -B" > kt.opt
You can then invoke the file:
ktracer $(<kt.opt)
Examples 23