1PERF-LOCK(1) perf Manual PERF-LOCK(1)
2
3
4
6 perf-lock - Analyze lock events
7
9 perf lock {record|report|script|info|contention}
10
12 You can analyze various lock behaviours and statistics with this perf
13 lock command.
14
15 'perf lock record <command>' records lock events
16 between start and end <command>. And this command
17 produces the file "perf.data" which contains tracing
18 results of lock events.
19
20 'perf lock report' reports statistical data.
21
22 'perf lock script' shows raw lock events.
23
24 'perf lock info' shows metadata like threads or addresses
25 of lock instances.
26
27 'perf lock contention' shows contention statistics.
28
30 -i, --input=<file>
31 Input file name. (default: perf.data unless stdin is a fifo)
32
33 -v, --verbose
34 Be more verbose (show symbol address, etc).
35
36 -q, --quiet
37 Do not show any warnings or messages. (Suppress -v)
38
39 -D, --dump-raw-trace
40 Dump raw trace in ASCII.
41
42 -f, --force
43 Don’t complain, do it.
44
45 --vmlinux=<file>
46 vmlinux pathname
47
48 --kallsyms=<file>
49 kallsyms pathname
50
52 -k, --key=<value>
53 Sorting key. Possible values: acquired (default), contended,
54 avg_wait, wait_total, wait_max, wait_min.
55
56 -F, --field=<value>
57 Output fields. By default it shows all the fields but users can
58 customize that using this. Possible values: acquired, contended,
59 avg_wait, wait_total, wait_max, wait_min.
60
61 -c, --combine-locks
62 Merge lock instances in the same class (based on name).
63
64 -t, --threads
65 The -t option is to show per-thread lock stat like below:
66
67 $ perf lock report -t -F acquired,contended,avg_wait
68
69 Name acquired contended avg wait (ns)
70
71 perf 240569 9 5784
72 swapper 106610 19 543
73 :15789 17370 2 14538
74 ContainerMgr 8981 6 874
75 sleep 5275 1 11281
76 ContainerThread 4416 4 944
77 RootPressureThr 3215 5 1215
78 rcu_preempt 2954 0 0
79 ContainerMgr 2560 0 0
80 unnamed 1873 0 0
81 EventManager_De 1845 1 636
82 futex-default-S 1609 0 0
83
84 -E, --entries=<value>
85 Display this many entries.
86
88 -t, --threads
89 dump thread list in perf.data
90
91 -m, --map
92 dump map of lock instances (address:name table)
93
94 CONTENTION OPTIONS
95
96
97 .ft C
98 -k::
99 --key=<value>::
100 Sorting key. Possible values: contended, wait_total (default),
101 wait_max, wait_min, avg_wait.
102
103 -F::
104 --field=<value>::
105 Output fields. By default it shows all but the wait_min fields
106 and users can customize that using this. Possible values:
107 contended, wait_total, wait_max, wait_min, avg_wait.
108
109 -t::
110 --threads::
111 Show per-thread lock contention stat
112
113 -b::
114 --use-bpf::
115 Use BPF program to collect lock contention stats instead of
116 using the input data.
117
118 -a::
119 --all-cpus::
120 System-wide collection from all CPUs.
121
122 -C::
123 --cpu::
124 Collect samples only on the list of CPUs provided. Multiple CPUs can be
125 provided as a comma-separated list with no space: 0,1. Ranges of CPUs
126 are specified with -: 0-2. Default is to monitor all CPUs.
127
128 -p::
129 --pid=::
130 Record events on existing process ID (comma separated list).
131
132 --tid=::
133 Record events on existing thread ID (comma separated list).
134
135 --map-nr-entries::
136 Maximum number of BPF map entries (default: 10240).
137
138 --max-stack::
139 Maximum stack depth when collecting lock contention (default: 8).
140
141 --stack-skip
142 Number of stack depth to skip when finding a lock caller (default: 3).
143
144 -E::
145 --entries=<value>::
146 Display this many entries.
147
148
149 SEE ALSO
150 .ft
151
152
153 perf(1)
154
155
156
157perf 01/12/2023 PERF-LOCK(1)