1 perf-lock(1) 1 perf-lock(1) 2 ============ 2 ============ 3 3 4 NAME 4 NAME 5 ---- 5 ---- 6 perf-lock - Analyze lock events 6 perf-lock - Analyze lock events 7 7 8 SYNOPSIS 8 SYNOPSIS 9 -------- 9 -------- 10 [verse] 10 [verse] 11 'perf lock' {record|report|script|info|content 11 'perf lock' {record|report|script|info|contention} 12 12 13 DESCRIPTION 13 DESCRIPTION 14 ----------- 14 ----------- 15 You can analyze various lock behaviours 15 You can analyze various lock behaviours 16 and statistics with this 'perf lock' command. 16 and statistics with this 'perf lock' command. 17 17 18 'perf lock record <command>' records lock ev 18 'perf lock record <command>' records lock events 19 between start and end <command>. And this co 19 between start and end <command>. And this command 20 produces the file "perf.data" which contains 20 produces the file "perf.data" which contains tracing 21 results of lock events. 21 results of lock events. 22 22 23 'perf lock report' reports statistical data. 23 'perf lock report' reports statistical data. 24 24 25 'perf lock script' shows raw lock events. 25 'perf lock script' shows raw lock events. 26 26 27 'perf lock info' shows metadata like threads 27 'perf lock info' shows metadata like threads or addresses 28 of lock instances. 28 of lock instances. 29 29 30 'perf lock contention' shows contention stat 30 'perf lock contention' shows contention statistics. 31 31 32 COMMON OPTIONS 32 COMMON OPTIONS 33 -------------- 33 -------------- 34 34 35 -i:: 35 -i:: 36 --input=<file>:: 36 --input=<file>:: 37 Input file name. (default: perf.data u 37 Input file name. (default: perf.data unless stdin is a fifo) 38 38 39 --output=<file>:: << 40 Output file name for perf lock content << 41 << 42 -v:: 39 -v:: 43 --verbose:: 40 --verbose:: 44 Be more verbose (show symbol address, 41 Be more verbose (show symbol address, etc). 45 42 46 -q:: 43 -q:: 47 --quiet:: 44 --quiet:: 48 Do not show any warnings or messages. 45 Do not show any warnings or messages. (Suppress -v) 49 46 50 -D:: 47 -D:: 51 --dump-raw-trace:: 48 --dump-raw-trace:: 52 Dump raw trace in ASCII. 49 Dump raw trace in ASCII. 53 50 54 -f:: 51 -f:: 55 --force:: 52 --force:: 56 Don't complain, do it. 53 Don't complain, do it. 57 54 58 --vmlinux=<file>:: 55 --vmlinux=<file>:: 59 vmlinux pathname 56 vmlinux pathname 60 57 61 --kallsyms=<file>:: 58 --kallsyms=<file>:: 62 kallsyms pathname 59 kallsyms pathname 63 60 64 61 65 REPORT OPTIONS 62 REPORT OPTIONS 66 -------------- 63 -------------- 67 64 68 -k:: 65 -k:: 69 --key=<value>:: 66 --key=<value>:: 70 Sorting key. Possible values: acquired 67 Sorting key. Possible values: acquired (default), contended, 71 avg_wait, wait_total, wait_max, wait_m 68 avg_wait, wait_total, wait_max, wait_min. 72 69 73 -F:: 70 -F:: 74 --field=<value>:: 71 --field=<value>:: 75 Output fields. By default it shows all 72 Output fields. By default it shows all the fields but users can 76 customize that using this. Possible v 73 customize that using this. Possible values: acquired, contended, 77 avg_wait, wait_total, wait_max, wait_m 74 avg_wait, wait_total, wait_max, wait_min. 78 75 79 -c:: 76 -c:: 80 --combine-locks:: 77 --combine-locks:: 81 Merge lock instances in the same class 78 Merge lock instances in the same class (based on name). 82 79 83 -t:: 80 -t:: 84 --threads:: 81 --threads:: 85 The -t option is to show per-thread lock s 82 The -t option is to show per-thread lock stat like below: 86 83 87 $ perf lock report -t -F acquired,conten 84 $ perf lock report -t -F acquired,contended,avg_wait 88 85 89 Name acquired contended 86 Name acquired contended avg wait (ns) 90 87 91 perf 240569 9 88 perf 240569 9 5784 92 swapper 106610 19 89 swapper 106610 19 543 93 :15789 17370 2 90 :15789 17370 2 14538 94 ContainerMgr 8981 6 91 ContainerMgr 8981 6 874 95 sleep 5275 1 92 sleep 5275 1 11281 96 ContainerThread 4416 4 93 ContainerThread 4416 4 944 97 RootPressureThr 3215 5 94 RootPressureThr 3215 5 1215 98 rcu_preempt 2954 0 95 rcu_preempt 2954 0 0 99 ContainerMgr 2560 0 96 ContainerMgr 2560 0 0 100 unnamed 1873 0 97 unnamed 1873 0 0 101 EventManager_De 1845 1 98 EventManager_De 1845 1 636 102 futex-default-S 1609 0 99 futex-default-S 1609 0 0 103 100 104 -E:: 101 -E:: 105 --entries=<value>:: 102 --entries=<value>:: 106 Display this many entries. 103 Display this many entries. 107 104 108 105 109 INFO OPTIONS 106 INFO OPTIONS 110 ------------ 107 ------------ 111 108 112 -t:: 109 -t:: 113 --threads:: 110 --threads:: 114 dump only the thread list in perf.data !! 111 dump thread list in perf.data 115 112 116 -m:: 113 -m:: 117 --map:: 114 --map:: 118 dump only the map of lock instances (a !! 115 dump map of lock instances (address:name table) 119 116 120 117 121 CONTENTION OPTIONS 118 CONTENTION OPTIONS 122 ------------------ !! 119 -------------- 123 120 124 -k:: 121 -k:: 125 --key=<value>:: 122 --key=<value>:: 126 Sorting key. Possible values: contende 123 Sorting key. Possible values: contended, wait_total (default), 127 wait_max, wait_min, avg_wait. 124 wait_max, wait_min, avg_wait. 128 125 129 -F:: 126 -F:: 130 --field=<value>:: 127 --field=<value>:: 131 Output fields. By default it shows all 128 Output fields. By default it shows all but the wait_min fields 132 and users can customize that using thi 129 and users can customize that using this. Possible values: 133 contended, wait_total, wait_max, wait_ 130 contended, wait_total, wait_max, wait_min, avg_wait. 134 131 135 -t:: 132 -t:: 136 --threads:: 133 --threads:: 137 Show per-thread lock contention stat 134 Show per-thread lock contention stat 138 135 139 -b:: 136 -b:: 140 --use-bpf:: 137 --use-bpf:: 141 Use BPF program to collect lock conten 138 Use BPF program to collect lock contention stats instead of 142 using the input data. 139 using the input data. 143 140 144 -a:: 141 -a:: 145 --all-cpus:: 142 --all-cpus:: 146 System-wide collection from all CPUs. 143 System-wide collection from all CPUs. 147 144 148 -C:: 145 -C:: 149 --cpu=<value>:: 146 --cpu=<value>:: 150 Collect samples only on the list of CP 147 Collect samples only on the list of CPUs provided. Multiple CPUs can be 151 provided as a comma-separated list wit 148 provided as a comma-separated list with no space: 0,1. Ranges of CPUs 152 are specified with -: 0-2. Default is 149 are specified with -: 0-2. Default is to monitor all CPUs. 153 150 154 -p:: 151 -p:: 155 --pid=<value>:: 152 --pid=<value>:: 156 Record events on existing process ID ( 153 Record events on existing process ID (comma separated list). 157 154 158 --tid=<value>:: 155 --tid=<value>:: 159 Record events on existing thread ID (c 156 Record events on existing thread ID (comma separated list). 160 157 161 -M:: << 162 --map-nr-entries=<value>:: 158 --map-nr-entries=<value>:: 163 Maximum number of BPF map entries (def !! 159 Maximum number of BPF map entries (default: 10240). 164 This will be aligned to a power of 2. << 165 160 166 --max-stack=<value>:: 161 --max-stack=<value>:: 167 Maximum stack depth when collecting lo 162 Maximum stack depth when collecting lock contention (default: 8). 168 163 169 --stack-skip=<value>:: 164 --stack-skip=<value>:: 170 Number of stack depth to skip when fin 165 Number of stack depth to skip when finding a lock caller (default: 3). 171 166 172 -E:: 167 -E:: 173 --entries=<value>:: 168 --entries=<value>:: 174 Display this many entries. 169 Display this many entries. 175 170 176 -l:: 171 -l:: 177 --lock-addr:: 172 --lock-addr:: 178 Show lock contention stat by address 173 Show lock contention stat by address 179 174 180 -o:: << 181 --lock-owner:: << 182 Show lock contention stat by owners. << 183 requires --use-bpf. << 184 << 185 -Y:: 175 -Y:: 186 --type-filter=<value>:: 176 --type-filter=<value>:: 187 Show lock contention only for given lo 177 Show lock contention only for given lock types (comma separated list). 188 Available values are: 178 Available values are: 189 semaphore, spinlock, rwlock, rwlock: 179 semaphore, spinlock, rwlock, rwlock:R, rwlock:W, rwsem, rwsem:R, rwsem:W, 190 rtmutex, rwlock-rt, rwlock-rt:R, rwl 180 rtmutex, rwlock-rt, rwlock-rt:R, rwlock-rt:W, pcpu-sem, pcpu-sem:R, pcpu-sem:W, 191 mutex 181 mutex 192 182 193 Note that RW-variant of locks have :R 183 Note that RW-variant of locks have :R and :W suffix. Names without the 194 suffix are shortcuts for the both vari 184 suffix are shortcuts for the both variants. Ex) rwsem = rwsem:R + rwsem:W. 195 185 196 -L:: 186 -L:: 197 --lock-filter=<value>:: 187 --lock-filter=<value>:: 198 Show lock contention only for given lo 188 Show lock contention only for given lock addresses or names (comma separated list). 199 << 200 -S:: << 201 --callstack-filter=<value>:: << 202 Show lock contention only if the calls << 203 Note that it matches the substring so << 204 and 'irq_enter_rcu'. << 205 << 206 -x:: << 207 --field-separator=<SEP>:: << 208 Show results using a CSV-style output << 209 into spreadsheets. Columns are separat << 210 << 211 --lock-cgroup:: << 212 Show lock contention stat by cgroup. << 213 << 214 -G:: << 215 --cgroup-filter=<value>:: << 216 Show lock contention only in the given << 217 189 218 190 219 SEE ALSO 191 SEE ALSO 220 -------- 192 -------- 221 linkperf:perf[1] 193 linkperf:perf[1]
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.