0001 perf-lock(1)
0002 ============
0003
0004 NAME
0005 ----
0006 perf-lock - Analyze lock events
0007
0008 SYNOPSIS
0009 --------
0010 [verse]
0011 'perf lock' {record|report|script|info|contention}
0012
0013 DESCRIPTION
0014 -----------
0015 You can analyze various lock behaviours
0016 and statistics with this 'perf lock' command.
0017
0018 'perf lock record <command>' records lock events
0019 between start and end <command>. And this command
0020 produces the file "perf.data" which contains tracing
0021 results of lock events.
0022
0023 'perf lock report' reports statistical data.
0024
0025 'perf lock script' shows raw lock events.
0026
0027 'perf lock info' shows metadata like threads or addresses
0028 of lock instances.
0029
0030 'perf lock contention' shows contention statistics.
0031
0032 COMMON OPTIONS
0033 --------------
0034
0035 -i::
0036 --input=<file>::
0037 Input file name. (default: perf.data unless stdin is a fifo)
0038
0039 -v::
0040 --verbose::
0041 Be more verbose (show symbol address, etc).
0042
0043 -D::
0044 --dump-raw-trace::
0045 Dump raw trace in ASCII.
0046
0047 -f::
0048 --force::
0049 Don't complain, do it.
0050
0051 --vmlinux=<file>::
0052 vmlinux pathname
0053
0054 --kallsyms=<file>::
0055 kallsyms pathname
0056
0057
0058 REPORT OPTIONS
0059 --------------
0060
0061 -k::
0062 --key=<value>::
0063 Sorting key. Possible values: acquired (default), contended,
0064 avg_wait, wait_total, wait_max, wait_min.
0065
0066 -F::
0067 --field=<value>::
0068 Output fields. By default it shows all the fields but users can
0069 customize that using this. Possible values: acquired, contended,
0070 avg_wait, wait_total, wait_max, wait_min.
0071
0072 -c::
0073 --combine-locks::
0074 Merge lock instances in the same class (based on name).
0075
0076 -t::
0077 --threads::
0078 The -t option is to show per-thread lock stat like below:
0079
0080 $ perf lock report -t -F acquired,contended,avg_wait
0081
0082 Name acquired contended avg wait (ns)
0083
0084 perf 240569 9 5784
0085 swapper 106610 19 543
0086 :15789 17370 2 14538
0087 ContainerMgr 8981 6 874
0088 sleep 5275 1 11281
0089 ContainerThread 4416 4 944
0090 RootPressureThr 3215 5 1215
0091 rcu_preempt 2954 0 0
0092 ContainerMgr 2560 0 0
0093 unnamed 1873 0 0
0094 EventManager_De 1845 1 636
0095 futex-default-S 1609 0 0
0096
0097 INFO OPTIONS
0098 ------------
0099
0100 -t::
0101 --threads::
0102 dump thread list in perf.data
0103
0104 -m::
0105 --map::
0106 dump map of lock instances (address:name table)
0107
0108 CONTENTION OPTIONS
0109 --------------
0110
0111 -k::
0112 --key=<value>::
0113 Sorting key. Possible values: contended, wait_total (default),
0114 wait_max, wait_min, avg_wait.
0115
0116 -F::
0117 --field=<value>::
0118 Output fields. By default it shows all but the wait_min fields
0119 and users can customize that using this. Possible values:
0120 contended, wait_total, wait_max, wait_min, avg_wait.
0121
0122 -t::
0123 --threads::
0124 Show per-thread lock contention stat
0125
0126 -b::
0127 --use-bpf::
0128 Use BPF program to collect lock contention stats instead of
0129 using the input data.
0130
0131 -a::
0132 --all-cpus::
0133 System-wide collection from all CPUs.
0134
0135 -C::
0136 --cpu::
0137 Collect samples only on the list of CPUs provided. Multiple CPUs can be
0138 provided as a comma-separated list with no space: 0,1. Ranges of CPUs
0139 are specified with -: 0-2. Default is to monitor all CPUs.
0140
0141 -p::
0142 --pid=::
0143 Record events on existing process ID (comma separated list).
0144
0145 --tid=::
0146 Record events on existing thread ID (comma separated list).
0147
0148 --map-nr-entries::
0149 Maximum number of BPF map entries (default: 10240).
0150
0151
0152 SEE ALSO
0153 --------
0154 linkperf:perf[1]