Controls kernel lock tracing.
The locktrace command controls which kernel locks are being traced by the trace subsystem. The default is to trace none. If the machine has been rebooted after running the bosboot -L command, kernel lock tracing can be turned on or off for one or more individual lock classes, or for all lock classes. If bosboot -L was not run, lock tracing can only be turned on for all locks or none. The trace events collected in this case when locks are taken or missed (hook id 112), and released (hook id 113) do not have the lock class name available.
Item | Description |
---|---|
-r classname | Turns off lock tracing for all kernel locks belonging to the specified class. The option always fails if you did not run the bosboot -L command. |
-s classname | Turns on lock tracing for all kernel locks belonging to the specified class. The option always fails if you did not run the bosboot -L command. To trace several specific classes at the same time, run the locktrace command multiple times, with a specific lock class each time. You can enter up to 32 class names. |
-R | Turns off all lock tracing. |
-S | Turns on lock tracing for all locks regardless of their class membership. |
-l | Lists kernel lock tracing current status. |
locktrace -s SEM_LOCK_CLASS
locktrace -R
locktrace -R
locktrace -s SEM_LOCK_CLASS
locktrace -s SHM_LOCK_CLASS
You can view current lock classes
using the -l flag: locktrace -l
The following
output will be displayed: lock tracing enabled for classes:
SHM_LOCK_CLASS
SEM_LOCK_CLASS
Item | Description |
---|---|
/usr/bin/locktrace | Contains the locktrace command. |
/usr/include/sys/lockname.h | Contains the lock class names. |