perf-kwork.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. perf-kwork(1)
  2. =============
  3. NAME
  4. ----
  5. perf-kwork - Tool to trace/measure kernel work properties (latencies)
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf kwork' {record|report|latency|timehist|top}
  10. DESCRIPTION
  11. -----------
  12. There are several variants of 'perf kwork':
  13. 'perf kwork record <command>' to record the kernel work
  14. of an arbitrary workload.
  15. 'perf kwork report' to report the per kwork runtime.
  16. 'perf kwork latency' to report the per kwork latencies.
  17. 'perf kwork timehist' provides an analysis of kernel work events.
  18. 'perf kwork top' to report the task cpu usage.
  19. Example usage:
  20. perf kwork record -- sleep 1
  21. perf kwork report
  22. perf kwork report -b
  23. perf kwork latency
  24. perf kwork latency -b
  25. perf kwork timehist
  26. perf kwork top
  27. perf kwork top -b
  28. By default it shows the individual work events such as irq, workqueue,
  29. including the run time and delay (time between raise and actually entry):
  30. Runtime start Runtime end Cpu Kwork name Runtime Delaytime
  31. (TYPE)NAME:NUM (msec) (msec)
  32. ----------------- ----------------- ------ ------------------------- ---------- ----------
  33. 1811186.976062 1811186.976327 [0000] (s)RCU:9 0.266 0.114
  34. 1811186.978452 1811186.978547 [0000] (s)SCHED:7 0.095 0.171
  35. 1811186.980327 1811186.980490 [0000] (s)SCHED:7 0.162 0.083
  36. 1811186.981221 1811186.981271 [0000] (s)SCHED:7 0.050 0.077
  37. 1811186.984267 1811186.984318 [0000] (s)SCHED:7 0.051 0.075
  38. 1811186.987252 1811186.987315 [0000] (s)SCHED:7 0.063 0.081
  39. 1811186.987785 1811186.987843 [0006] (s)RCU:9 0.058 0.645
  40. 1811186.988319 1811186.988383 [0000] (s)SCHED:7 0.064 0.143
  41. 1811186.989404 1811186.989607 [0002] (s)TIMER:1 0.203 0.111
  42. 1811186.989660 1811186.989732 [0002] (s)SCHED:7 0.072 0.310
  43. 1811186.991295 1811186.991407 [0002] eth0:10 0.112
  44. 1811186.991639 1811186.991734 [0002] (s)NET_RX:3 0.095 0.277
  45. 1811186.989860 1811186.991826 [0002] (w)vmstat_shepherd 1.966 0.345
  46. ...
  47. Times are in msec.usec.
  48. OPTIONS
  49. -------
  50. -D::
  51. --dump-raw-trace=::
  52. Display verbose dump of the sched data.
  53. -f::
  54. --force::
  55. Don't complain, do it.
  56. -k::
  57. --kwork::
  58. List of kwork to profile (irq, softirq, workqueue, sched, etc)
  59. -v::
  60. --verbose::
  61. Be more verbose. (show symbol address, etc)
  62. OPTIONS for 'perf kwork report'
  63. ----------------------------
  64. -b::
  65. --use-bpf::
  66. Use BPF to measure kwork runtime
  67. -C::
  68. --cpu::
  69. Only show events for the given CPU(s) (comma separated list).
  70. -i::
  71. --input::
  72. Input file name. (default: perf.data unless stdin is a fifo)
  73. -n::
  74. --name::
  75. Only show events for the given name.
  76. -s::
  77. --sort::
  78. Sort by key(s): runtime, max, count
  79. -S::
  80. --with-summary::
  81. Show summary with statistics
  82. --time::
  83. Only analyze samples within given time window: <start>,<stop>. Times
  84. have the format seconds.microseconds. If start is not given (i.e., time
  85. string is ',x.y') then analysis starts at the beginning of the file. If
  86. stop time is not given (i.e, time string is 'x.y,') then analysis goes
  87. to end of file.
  88. OPTIONS for 'perf kwork latency'
  89. ----------------------------
  90. -b::
  91. --use-bpf::
  92. Use BPF to measure kwork latency
  93. -C::
  94. --cpu::
  95. Only show events for the given CPU(s) (comma separated list).
  96. -i::
  97. --input::
  98. Input file name. (default: perf.data unless stdin is a fifo)
  99. -n::
  100. --name::
  101. Only show events for the given name.
  102. -s::
  103. --sort::
  104. Sort by key(s): avg, max, count
  105. --time::
  106. Only analyze samples within given time window: <start>,<stop>. Times
  107. have the format seconds.microseconds. If start is not given (i.e., time
  108. string is ',x.y') then analysis starts at the beginning of the file. If
  109. stop time is not given (i.e, time string is 'x.y,') then analysis goes
  110. to end of file.
  111. OPTIONS for 'perf kwork timehist'
  112. ---------------------------------
  113. -C::
  114. --cpu::
  115. Only show events for the given CPU(s) (comma separated list).
  116. -g::
  117. --call-graph::
  118. Display call chains if present (default off).
  119. -i::
  120. --input::
  121. Input file name. (default: perf.data unless stdin is a fifo)
  122. -k::
  123. --vmlinux=<file>::
  124. Vmlinux pathname
  125. -n::
  126. --name::
  127. Only show events for the given name.
  128. --kallsyms=<file>::
  129. Kallsyms pathname
  130. --max-stack::
  131. Maximum number of functions to display in backtrace, default 5.
  132. --symfs=<directory>::
  133. Look for files with symbols relative to this directory.
  134. --time::
  135. Only analyze samples within given time window: <start>,<stop>. Times
  136. have the format seconds.microseconds. If start is not given (i.e., time
  137. string is ',x.y') then analysis starts at the beginning of the file. If
  138. stop time is not given (i.e, time string is 'x.y,') then analysis goes
  139. to end of file.
  140. OPTIONS for 'perf kwork top'
  141. ---------------------------------
  142. -b::
  143. --use-bpf::
  144. Use BPF to measure task cpu usage.
  145. -C::
  146. --cpu::
  147. Only show events for the given CPU(s) (comma separated list).
  148. -i::
  149. --input::
  150. Input file name. (default: perf.data unless stdin is a fifo)
  151. -n::
  152. --name::
  153. Only show events for the given name.
  154. -s::
  155. --sort::
  156. Sort by key(s): rate, runtime, tid
  157. --time::
  158. Only analyze samples within given time window: <start>,<stop>. Times
  159. have the format seconds.microseconds. If start is not given (i.e., time
  160. string is ',x.y') then analysis starts at the beginning of the file. If
  161. stop time is not given (i.e, time string is 'x.y,') then analysis goes
  162. to end of file.
  163. SEE ALSO
  164. --------
  165. linkperf:perf-record[1]