perf-kvm.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. perf-kvm(1)
  2. ===========
  3. NAME
  4. ----
  5. perf-kvm - Tool to trace/measure kvm guest os
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf kvm' [--host] [--guest] [--guestmount=<path>
  10. [--guestkallsyms=<path> --guestmodules=<path> | --guestvmlinux=<path>]]
  11. {top|record|report|diff|buildid-list} [<options>]
  12. 'perf kvm' [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path>
  13. | --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat} [<options>]
  14. 'perf kvm stat [record|report|live] [<options>]
  15. DESCRIPTION
  16. -----------
  17. There are a couple of variants of perf kvm:
  18. 'perf kvm [options] top <command>' to generates and displays
  19. a performance counter profile of guest os in realtime
  20. of an arbitrary workload.
  21. 'perf kvm record <command>' to record the performance counter profile
  22. of an arbitrary workload and save it into a perf data file. We set the
  23. default behavior of perf kvm as --guest, so if neither --host nor --guest
  24. is input, the perf data file name is perf.data.guest. If --host is input,
  25. the perf data file name is perf.data.kvm. If you want to record data into
  26. perf.data.host, please input --host --no-guest. The behaviors are shown as
  27. following:
  28. Default('') -> perf.data.guest
  29. --host -> perf.data.kvm
  30. --guest -> perf.data.guest
  31. --host --guest -> perf.data.kvm
  32. --host --no-guest -> perf.data.host
  33. 'perf kvm report' to display the performance counter profile information
  34. recorded via perf kvm record.
  35. 'perf kvm diff' to displays the performance difference amongst two perf.data
  36. files captured via perf record.
  37. 'perf kvm buildid-list' to display the buildids found in a perf data file,
  38. so that other tools can be used to fetch packages with matching symbol tables
  39. for use by perf report. As buildid is read from /sys/kernel/notes in os, then
  40. if you want to list the buildid for guest, please make sure your perf data file
  41. was captured with --guestmount in perf kvm record.
  42. 'perf kvm stat <command>' to run a command and gather performance counter
  43. statistics.
  44. Especially, perf 'kvm stat record/report' generates a statistical analysis
  45. of KVM events. Currently, vmexit, mmio (x86 only) and ioport (x86 only)
  46. events are supported. 'perf kvm stat record <command>' records kvm events
  47. and the events between start and end <command>.
  48. And this command produces a file which contains tracing results of kvm
  49. events.
  50. 'perf kvm stat report' reports statistical data which includes events
  51. handled time, samples, and so on.
  52. 'perf kvm stat live' reports statistical data in a live mode (similar to
  53. record + report but with statistical data updated live at a given display
  54. rate).
  55. OPTIONS
  56. -------
  57. -i::
  58. --input=<path>::
  59. Input file name.
  60. -o::
  61. --output=<path>::
  62. Output file name.
  63. --host::
  64. Collect host side performance profile.
  65. --guest::
  66. Collect guest side performance profile.
  67. --guestmount=<path>::
  68. Guest os root file system mount directory. Users mounts guest os
  69. root directories under <path> by a specific filesystem access method,
  70. typically, sshfs. For example, start 2 guest os. The one's pid is 8888
  71. and the other's is 9999.
  72. #mkdir ~/guestmount; cd ~/guestmount
  73. #sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
  74. #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
  75. #perf kvm --host --guest --guestmount=~/guestmount top
  76. --guestkallsyms=<path>::
  77. Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get guest
  78. kernel symbols. Users copy it out from guest os.
  79. --guestmodules=<path>::
  80. Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest
  81. kernel module information. Users copy it out from guest os.
  82. --guestvmlinux=<path>::
  83. Guest os kernel vmlinux.
  84. -v::
  85. --verbose::
  86. Be more verbose (show counter open errors, etc).
  87. STAT REPORT OPTIONS
  88. -------------------
  89. --vcpu=<value>::
  90. analyze events which occur on this vcpu. (default: all vcpus)
  91. --event=<value>::
  92. event to be analyzed. Possible values: vmexit, mmio (x86 only),
  93. ioport (x86 only). (default: vmexit)
  94. -k::
  95. --key=<value>::
  96. Sorting key. Possible values: sample (default, sort by samples
  97. number), time (sort by average time).
  98. -p::
  99. --pid=::
  100. Analyze events only for given process ID(s) (comma separated list).
  101. STAT LIVE OPTIONS
  102. -----------------
  103. -d::
  104. --display::
  105. Time in seconds between display updates
  106. -m::
  107. --mmap-pages=::
  108. Number of mmap data pages (must be a power of two) or size
  109. specification with appended unit character - B/K/M/G. The
  110. size is rounded up to have nearest pages power of two value.
  111. -a::
  112. --all-cpus::
  113. System-wide collection from all CPUs.
  114. -p::
  115. --pid=::
  116. Analyze events only for given process ID(s) (comma separated list).
  117. --vcpu=<value>::
  118. analyze events which occur on this vcpu. (default: all vcpus)
  119. --event=<value>::
  120. event to be analyzed. Possible values: vmexit,
  121. mmio (x86 only), ioport (x86 only).
  122. (default: vmexit)
  123. -k::
  124. --key=<value>::
  125. Sorting key. Possible values: sample (default, sort by samples
  126. number), time (sort by average time).
  127. --duration=<value>::
  128. Show events other than HLT (x86 only) or Wait state (s390 only)
  129. that take longer than duration usecs.
  130. --proc-map-timeout::
  131. When processing pre-existing threads /proc/XXX/mmap, it may take
  132. a long time, because the file may be huge. A time out is needed
  133. in such cases.
  134. This option sets the time out limit. The default value is 500 ms.
  135. SEE ALSO
  136. --------
  137. linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],
  138. linkperf:perf-diff[1], linkperf:perf-buildid-list[1],
  139. linkperf:perf-stat[1]