perf_lock_report
Identify the most contended locks in a Linux system by analyzing per-lock statistics like acquired count, contended count, and wait times from perf lock data.
Instructions
Lock statistics: acquired count, contended count, and wait times per lock.
Use this to find the most contended locks in the system.
Key parameters:
sort: sort by 'acquired', 'contended', 'avg_wait', 'wait_total', 'wait_max', 'wait_min'.
type_filter: filter by lock type -- 'spinlock', 'mutex', 'rwsem:R', 'rwsem:W'.
threads: show per-thread breakdown.
combine_locks: group locks by caller.
Output: per-lock statistics table. Requires: perf lock record or lock tracepoints.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cpu | No | CPUs to filter | |
| key | No | Sort key for contended locks | |
| pid | No | Filter by PID | |
| tid | No | Filter by TID | |
| sort | No | Sort by key(s): acquired,contended,avg_wait,wait_total,wait_max,wait_min | |
| field | No | Output field(s) | |
| force | No | Don't complain, do it | |
| input | Yes | Path to perf.data file | |
| quiet | No | Do not show any warnings | |
| entries | No | Maximum entries to display | |
| threads | No | Show per-thread stats | |
| verbose | No | Verbosity level (0-2) | |
| vmlinux | No | vmlinux pathname | |
| kallsyms | No | kallsyms pathname | |
| lock_filter | No | Filter by specific lock addr/name | |
| type_filter | No | Filter by lock type | |
| combine_locks | No | Combine locks by caller | |
| dump_raw_trace | No | Dump raw trace in ASCII | |
| field_separator | No | Field separator for output |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |