66 lines · 1.3 KB · Text
RawDownload
.TH KPROF 3 .SH NAMEkprof \- kernel profiling.SH SYNOPSIS.nf.B bind -a #K /dev.sp.B /dev/kpctl.B /dev/kpdata.fi.SH DESCRIPTIONThe.I kprofdevice provides simple profilingdata for the operating system kernel.   The data accumulates byrecording the program counter of the kernel at each `tick' of thesystem clock..PPThe file.B kpdataholds the accumulated counts as 4-byte integers in big-endianbyte order.The size of the file depends on the size of kernel text.The first countholds the total number of clock ticks during profiling;the second the number of ticks that occurred while the kernelwas running.  The rest each hold the number of ticksthe kernel program counter was within thecorresponding 8-byte range of kernel text, starting from the baseof kernel text..PPThe file.B kpctlcontrols profiling.Writing the string.B startto.B kpctlbegins profiling;.B stopterminates it.  The message.B startclrrestarts profiling after zeroing the array of counts..PPThe program.I kprof(see.IR prof (1))formats the data for presentation..SH EXAMPLEThe following.IR rc (1)script runs a test program while profiling the kerneland reports the results..sp.EX	bind -a '#K' /dev	echo start > /dev/kpctl	runtest	echo stop > /dev/kpctl	kprof /386/9pcdisk /dev/kpdata.EE.SH SOURCE.B /sys/src/9/port/devkprof.c.SH SEE ALSO.IR prof (1)