perf-kwork.txt 5.0 KB

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