bind -a #T /dev
The file kpdata holds the accumulated counts in big-endian byte order. The size of the file depends on the size of kernel text, and the size of the individual counts. The first six counts are 4 bytes in size, and are special. The first holds the total number of ticks, the second the number of ticks which fell outside the kernel text, the third the number of microseconds per tick, the fourth the number of sample buckets, the fifth the size in bytes of each sample bucket, and sixth the log base 2 of the sample bucket size. Typically the sample size is 4, and the log base 2 of the bucket size 3 (8 bytes). The remainder of the file holds the sample buckets. The entire file has size sample bucket size times number of sample buckets. That is, the first six sample buckets are replaced with the special numbers.
The file kpctl controls profiling. Writing the string start to kpctl begins profiling; stop terminates it. The message startclr restarts profiling after zeroing the array of counts.
Kprof(10.1) formats the data for presentation.
fn sample { echo start >/dev/kpctl $1 echo stop >/dev/kpctl cp /dev/kpdata /n/remote/tmp/kpdata } bind -a '#T' /dev sample {cp sound /dev/audio}
On the server, the kprof(10.1) command is used to analyse the data:
kprof /usr/inferno/os/mpc/impc /tmp/kpdata
KPROF(3) | Rev: Thu Feb 15 14:43:36 GMT 2007 |