perf-lock.txt 3.9 KB

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