p Tracing may be ended early by sending .Dv SIGINT (Ctrl-C) to the process being executed by lockstat.
p The .Nm lockstat pseudo-device driver must be present in the kernel, and the .Nm command may only be used by the root user.
p The options are as follows: l -tag -width wellhello t Fl b Ar nbuf Adjust the number of trace buffers allocated by the kernel to .Ar nbuf . t Fl c Report percentage of total events by count, and sort the output by number of events. The default is to key on event timings. t Fl d Disable lockstat. This is useful when a program crashed leaving the lockstat kernel driver enabled. t Fl E Ar event Limit tracing to one type of event. Use the .Fl e option to list valid events. t Fl e List valid event types for the .Fl E option and exit. t Fl F Ar func Limit tracing to locking operations performed within the specified function. .Ar func must be the name of a valid function in the kernel. t Fl f Trace only by calling functions; do not report on individual locks. t Fl L Ar lock Limit tracing to one lock. .Ar lock may either be the name of a lock object in the kernel, or a kernel virtual address. t Fl l Trace only by lock; do not report on calling functions. t Fl M Merge lock addresses within unique objects. t Fl m Merge call sites within unique functions. t Fl N Ar nlist Extract symbol information from the .Ar nlist file. t Fl o Ar file Send output to the file named by .Ar file , instead of the standard output (the default). t Fl p Show the average number of events and time spent per CPU. The default is to show the total values. May be used in conjunction with the .Fl s option. t Fl s Show the average number of events per second, and the average time spent per second. The default is to show the total values. t Fl T Ar type Limit tracing to one type of lock. Use the .Fl t option to list valid lock types. t Fl t List valid lock types for the .Fl T option and exit. t Fl x Summarize events, and do not report on lock types. .El .Sh FILES l -tag -width /dev/lockstat -compact t Pa /dev/lockstat .Nm control device t Pa /dev/ksyms namelist .El .Sh EXAMPLES d -literal # lockstat -L uvm_pageqlock sleep 10 Elapsed time: 10.01 seconds. -- Adaptive mutex spin Total% Count Time/ms Lock Caller ------ ------- --------- ---------------------- ------------------------------ 100.00 1281 0.78 uvm_pageqlock <all> 39.81 385 0.31 uvm_pageqlock uvm_fault_internal+11cc 30.98 358 0.24 uvm_pageqlock uvm_fault_internal+bb1 28.06 522 0.22 uvm_pageqlock uvm_anfree+132 0.51 5 0.00 uvm_pageqlock ubc_fault+28f 0.20 4 0.00 uvm_pageqlock uvm_fault_internal+12b6 0.18 2 0.00 uvm_pageqlock uao_detach_locked+58 0.11 2 0.00 uvm_pageqlock uvm_fault_internal+7d5 0.08 2 0.00 uvm_pageqlock ufs_balloc_range+160 0.07 1 0.00 uvm_pageqlock uvm_fault_internal+107b .Ed .Sh DIAGNOSTICS l -diag t "lockstat: incompatible lockstat interface version"
p The kernel device driver does not match the version of the .Nm command. t "lockstat: overflowed available kernel trace buffers"
p Increase the number of buffers using the .Fl b option. t "lockstat: ioctl: Invalid argument"
p The number of trace buffers is outside the minimum and maximum bounds set by the kernel. .El .Sh SEE ALSO .Xr ps 1 , .Xr systat 1 , .Xr vmstat 1 , .Xr iostat 8 , .Xr pstat 8 .Sh HISTORY The .Nm command appeared in .Nx 4.0 .