Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lockstat(8) [netbsd man page]

LOCKSTAT(8)						    BSD System Manager's Manual 					       LOCKSTAT(8)

lockstat -- display kernel locking statistics SYNOPSIS
lockstat [-ceflMmpstx] [-b nbuf] [-E event] [-F func] [-L lock] [-N nlist] [-o file] [-T type] command ... DESCRIPTION
The lockstat command enables system wide tracing of kernel lock events, executes the specified command, and when finished reports statistics to the user. Tracing may be ended early by sending SIGINT (Ctrl-C) to the process being executed by lockstat. The lockstat pseudo-device driver must be present in the kernel, and the lockstat command may only be used by the root user. The options are as follows: -b nbuf Adjust the number of trace buffers allocated by the kernel to nbuf. -c Report percentage of total events by count, and sort the output by number of events. The default is to key on event timings. -E event Limit tracing to one type of event. Use the -e option to list valid events. -e List valid event types for the -E option and exit. -F func Limit tracing to locking operations performed within the specified function. func must be the name of a valid function in the kernel. -f Trace only by calling functions; do not report on individual locks. -L lock Limit tracing to one lock. lock may either be the name of a lock object in the kernel, or a kernel virtual address. -l Trace only by lock; do not report on calling functions. -M Merge lock addresses within unique objects. -m Merge call sites within unique functions. -N nlist Extract symbol information from the nlist file. -o file Send output to the file named by file, instead of the standard output (the default). -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 -s option. -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 type Limit tracing to one type of lock. Use the -t option to list valid lock types. -t List valid lock types for the -T option and exit. -x Summarize events, and do not report on lock types. FILES
/dev/lockstat lockstat control device /dev/ksyms namelist EXAMPLES
# 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 DIAGNOSTICS
lockstat: incompatible lockstat interface version The kernel device driver does not match the version of the lockstat command. lockstat: overflowed available kernel trace buffers Increase the number of buffers using the -b option. lockstat: ioctl: Invalid argument The number of trace buffers is outside the minimum and maximum bounds set by the kernel. SEE ALSO
ps(1), systat(1), vmstat(1), iostat(8), pstat(8) HISTORY
The lockstat command appeared in NetBSD 4.0. BSD
March 21, 2009 BSD

Check Out this Related Man Page

plockstat(1M)						  System Administration Commands					     plockstat(1M)

plockstat - report user-level lock statistics SYNOPSIS
plockstat [-vACHV] [-n count] [-s depth] [-e secs] [-x arg [=val]] command [arg]... plockstat [-vACHV] [-n count] [-s depth] [-e secs] [-x arg [=val]] -p pid DESCRIPTION
The plockstat utility gathers and displays user-level locking statistics. By default, plockstat monitors all lock contention events, gath- ers frequency and timing data about those events, and displays the data in decreasing frequency order, so that the most common events appear first. plockstat gathers data until the specified command completes or the process specified with the -p option completes. plockstat relies on DTrace to instrument a running process or a command it invokes to trace events of interest. This imposes a small but measurable performance overhead on the processes being observed. Users must have the dtrace_proc privilege and have permission to observe a particular process with plockstat. Refer to the for more information about DTrace security features. OPTIONS
The following options are supported: -A Watch all lock events. This option is equivalent to -CH. -C Watch contention events. -H Watch hold events. -e secs Exit after the number of seconds specified have elapsed. -n count Display only the specified number of entries for each output category. -s depth Record a stack trace rather than just the calling function. -p pid Specify a process ID from which plockstat is to gather data. -v Print out a message to indicate that tracing has started. -x arg[=val] Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the Solaris Dynamic Tracing Guide. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (=). -V Print the Dtrace commands used to gather the data. The output can then be used directly with the dtrace(1M) command. OPERANDS
The following operands are supported: arg A string to be passed as an argument to command. command The name of a utility to be invoked. count A positive integer value. pid A process identifier for a process to be monitored. secs Duration specified as a positive integer number of seconds. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWdtrc | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ The command-line syntax is Evolving. The human-readable output is Unstable. SEE ALSO
dtrace(1M), lockstat(1M), mutex_init(3C), pthread_mutex_lock(3C), pthread_rwlock_rdlock(3C), pthread_rwlock_wrlock(3C), pthread_rwlock_unlock(3C), rwlock(3C), attributes(5), fasttrap(7D) SunOS 5.11 26 Jan 2009 plockstat(1M)
Man Page