perf-sched.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. perf-sched(1)
  2. =============
  3. NAME
  4. ----
  5. perf-sched - Tool to trace/measure scheduler properties (latencies)
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf sched' {record|latency|map|replay|script|timehist}
  10. DESCRIPTION
  11. -----------
  12. There are several variants of 'perf sched':
  13. 'perf sched record <command>' to record the scheduling events
  14. of an arbitrary workload.
  15. 'perf sched latency' to report the per task scheduling latencies
  16. and other scheduling properties of the workload.
  17. 'perf sched script' to see a detailed trace of the workload that
  18. was recorded (aliased to 'perf script' for now).
  19. 'perf sched replay' to simulate the workload that was recorded
  20. via perf sched record. (this is done by starting up mockup threads
  21. that mimic the workload based on the events in the trace. These
  22. threads can then replay the timings (CPU runtime and sleep patterns)
  23. of the workload as it occurred when it was recorded - and can repeat
  24. it a number of times, measuring its performance.)
  25. 'perf sched map' to print a textual context-switching outline of
  26. workload captured via perf sched record. Columns stand for
  27. individual CPUs, and the two-letter shortcuts stand for tasks that
  28. are running on a CPU. A '*' denotes the CPU that had the event, and
  29. a dot signals an idle CPU.
  30. 'perf sched timehist' provides an analysis of scheduling events.
  31. Example usage:
  32. perf sched record -- sleep 1
  33. perf sched timehist
  34. By default it shows the individual schedule events, including the wait
  35. time (time between sched-out and next sched-in events for the task), the
  36. task scheduling delay (time between wakeup and actually running) and run
  37. time for the task:
  38. time cpu task name wait time sch delay run time
  39. [tid/pid] (msec) (msec) (msec)
  40. -------------- ------ -------------------- --------- --------- ---------
  41. 79371.874569 [0011] gcc[31949] 0.014 0.000 1.148
  42. 79371.874591 [0010] gcc[31951] 0.000 0.000 0.024
  43. 79371.874603 [0010] migration/10[59] 3.350 0.004 0.011
  44. 79371.874604 [0011] <idle> 1.148 0.000 0.035
  45. 79371.874723 [0005] <idle> 0.016 0.000 1.383
  46. 79371.874746 [0005] gcc[31949] 0.153 0.078 0.022
  47. ...
  48. Times are in msec.usec.
  49. OPTIONS
  50. -------
  51. -i::
  52. --input=<file>::
  53. Input file name. (default: perf.data unless stdin is a fifo)
  54. -v::
  55. --verbose::
  56. Be more verbose. (show symbol address, etc)
  57. -D::
  58. --dump-raw-trace=::
  59. Display verbose dump of the sched data.
  60. -f::
  61. --force::
  62. Don't complain, do it.
  63. OPTIONS for 'perf sched map'
  64. ----------------------------
  65. --compact::
  66. Show only CPUs with activity. Helps visualizing on high core
  67. count systems.
  68. --cpus::
  69. Show just entries with activities for the given CPUs.
  70. --color-cpus::
  71. Highlight the given cpus.
  72. --color-pids::
  73. Highlight the given pids.
  74. OPTIONS for 'perf sched timehist'
  75. ---------------------------------
  76. -k::
  77. --vmlinux=<file>::
  78. vmlinux pathname
  79. --kallsyms=<file>::
  80. kallsyms pathname
  81. -g::
  82. --call-graph::
  83. Display call chains if present (default on).
  84. --max-stack::
  85. Maximum number of functions to display in backtrace, default 5.
  86. -C=::
  87. --cpu=::
  88. Only show events for the given CPU(s) (comma separated list).
  89. -p=::
  90. --pid=::
  91. Only show events for given process ID (comma separated list).
  92. -t=::
  93. --tid=::
  94. Only show events for given thread ID (comma separated list).
  95. -s::
  96. --summary::
  97. Show only a summary of scheduling by thread with min, max, and average
  98. run times (in sec) and relative stddev.
  99. -S::
  100. --with-summary::
  101. Show all scheduling events followed by a summary by thread with min,
  102. max, and average run times (in sec) and relative stddev.
  103. --symfs=<directory>::
  104. Look for files with symbols relative to this directory.
  105. -V::
  106. --cpu-visual::
  107. Show visual aid for sched switches by CPU: 'i' marks idle time,
  108. 's' are scheduler events.
  109. -w::
  110. --wakeups::
  111. Show wakeup events.
  112. -M::
  113. --migrations::
  114. Show migration events.
  115. -n::
  116. --next::
  117. Show next task.
  118. -I::
  119. --idle-hist::
  120. Show idle-related events only.
  121. --time::
  122. Only analyze samples within given time window: <start>,<stop>. Times
  123. have the format seconds.microseconds. If start is not given (i.e., time
  124. string is ',x.y') then analysis starts at the beginning of the file. If
  125. stop time is not given (i.e, time string is 'x.y,') then analysis goes
  126. to end of file.
  127. --state::
  128. Show task state when it switched out.
  129. SEE ALSO
  130. --------
  131. linkperf:perf-record[1]