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