4.4. Identifying Contended User-Space Locks
This section describes how to identify contended user-space locks throughout the system within a specific time period. The ability to identify contended user-space locks can help you investigate hangs that you suspect may be caused by
futex
contentions.
Simply put, a
futex
contention occurs when multiple processes are trying to access the same region of memory. In some cases, this can result in a deadlock between the processes in contention, thereby appearing as an application hang.
To do this, futexes.stp probes the
futex
system call.
futexes.stp
futexes.stp needs to be manually stopped; upon exit, it prints the following information:
- Name and ID of the process responsible for a contention
- The region of memory it contested
- How many times the region of memory was contended
- Average time of contention throughout the probe
Example 4.16, “futexes.stp Sample Output” contains an excerpt from the output of futexes.stp upon exiting the script (after approximately 20 seconds).
Example 4.16. futexes.stp Sample Output