6 perf-lock - Analyze lock events
11 'perf lock' {record|report|script|info|contention}
15 You can analyze various lock behaviours
16 and statistics with this 'perf lock' command.
18 'perf lock record <command>' records lock events
19 between start and end <command>. And this command
20 produces the file "perf.data" which contains tracing
21 results of lock events.
23 'perf lock report' reports statistical data.
25 'perf lock script' shows raw lock events.
27 'perf lock info' shows metadata like threads or addresses
30 'perf lock contention' shows contention statistics.
37 Input file name. (default: perf.data unless stdin is a fifo)
41 Be more verbose (show symbol address, etc).
45 Do not show any warnings or messages. (Suppress -v)
49 Dump raw trace in ASCII.
53 Don't complain, do it.
67 Sorting key. Possible values: acquired (default), contended,
68 avg_wait, wait_total, wait_max, wait_min.
72 Output fields. By default it shows all the fields but users can
73 customize that using this. Possible values: acquired, contended,
74 avg_wait, wait_total, wait_max, wait_min.
78 Merge lock instances in the same class (based on name).
82 The -t option is to show per-thread lock stat like below:
84 $ perf lock report -t -F acquired,contended,avg_wait
86 Name acquired contended avg wait (ns)
91 ContainerMgr 8981 6 874
93 ContainerThread 4416 4 944
94 RootPressureThr 3215 5 1215
98 EventManager_De 1845 1 636
99 futex-default-S 1609 0 0
103 Display this many entries.
111 dump thread list in perf.data
115 dump map of lock instances (address:name table)
123 Sorting key. Possible values: contended, wait_total (default),
124 wait_max, wait_min, avg_wait.
128 Output fields. By default it shows all but the wait_min fields
129 and users can customize that using this. Possible values:
130 contended, wait_total, wait_max, wait_min, avg_wait.
134 Show per-thread lock contention stat
138 Use BPF program to collect lock contention stats instead of
139 using the input data.
143 System-wide collection from all CPUs.
147 Collect samples only on the list of CPUs provided. Multiple CPUs can be
148 provided as a comma-separated list with no space: 0,1. Ranges of CPUs
149 are specified with -: 0-2. Default is to monitor all CPUs.
153 Record events on existing process ID (comma separated list).
156 Record events on existing thread ID (comma separated list).
158 --map-nr-entries=<value>::
159 Maximum number of BPF map entries (default: 10240).
161 --max-stack=<value>::
162 Maximum stack depth when collecting lock contention (default: 8).
164 --stack-skip=<value>::
165 Number of stack depth to skip when finding a lock caller (default: 3).
169 Display this many entries.
173 Show lock contention stat by address
176 --type-filter=<value>::
177 Show lock contention only for given lock types (comma separated list).
178 Available values are:
179 semaphore, spinlock, rwlock, rwlock:R, rwlock:W, rwsem, rwsem:R, rwsem:W,
180 rtmutex, rwlock-rt, rwlock-rt:R, rwlock-rt:W, pcpu-sem, pcpu-sem:R, pcpu-sem:W,
183 Note that RW-variant of locks have :R and :W suffix. Names without the
184 suffix are shortcuts for the both variants. Ex) rwsem = rwsem:R + rwsem:W.
187 --lock-filter=<value>::
188 Show lock contention only for given lock addresses or names (comma separated list).