perf-kvm.txt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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}
  12. 'perf kvm' [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path>
  13. | --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat}
  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. If both
  23. --host and --guest are input, the perf data file name is perf.data.kvm.
  24. If there is no --host but --guest, the file name is perf.data.guest.
  25. If there is no --guest but --host, the file name is perf.data.host.
  26. 'perf kvm report' to display the performance counter profile information
  27. recorded via perf kvm record.
  28. 'perf kvm diff' to displays the performance difference amongst two perf.data
  29. files captured via perf record.
  30. 'perf kvm buildid-list' to display the buildids found in a perf data file,
  31. so that other tools can be used to fetch packages with matching symbol tables
  32. for use by perf report.
  33. 'perf kvm stat <command>' to run a command and gather performance counter
  34. statistics.
  35. Especially, perf 'kvm stat record/report' generates a statistical analysis
  36. of KVM events. Currently, vmexit, mmio and ioport events are supported.
  37. 'perf kvm stat record <command>' records kvm events and the events between
  38. start and end <command>.
  39. And this command produces a file which contains tracing results of kvm
  40. events.
  41. 'perf kvm stat report' reports statistical data which includes events
  42. handled time, samples, and so on.
  43. 'perf kvm stat live' reports statistical data in a live mode (similar to
  44. record + report but with statistical data updated live at a given display
  45. rate).
  46. OPTIONS
  47. -------
  48. -i::
  49. --input=::
  50. Input file name.
  51. -o::
  52. --output::
  53. Output file name.
  54. --host=::
  55. Collect host side performance profile.
  56. --guest=::
  57. Collect guest side performance profile.
  58. --guestmount=<path>::
  59. Guest os root file system mount directory. Users mounts guest os
  60. root directories under <path> by a specific filesystem access method,
  61. typically, sshfs. For example, start 2 guest os. The one's pid is 8888
  62. and the other's is 9999.
  63. #mkdir ~/guestmount; cd ~/guestmount
  64. #sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
  65. #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
  66. #perf kvm --host --guest --guestmount=~/guestmount top
  67. --guestkallsyms=<path>::
  68. Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get guest
  69. kernel symbols. Users copy it out from guest os.
  70. --guestmodules=<path>::
  71. Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest
  72. kernel module information. Users copy it out from guest os.
  73. --guestvmlinux=<path>::
  74. Guest os kernel vmlinux.
  75. STAT REPORT OPTIONS
  76. -------------------
  77. --vcpu=<value>::
  78. analyze events which occures on this vcpu. (default: all vcpus)
  79. --event=<value>::
  80. event to be analyzed. Possible values: vmexit, mmio, ioport.
  81. (default: vmexit)
  82. -k::
  83. --key=<value>::
  84. Sorting key. Possible values: sample (default, sort by samples
  85. number), time (sort by average time).
  86. -p::
  87. --pid=::
  88. Analyze events only for given process ID(s) (comma separated list).
  89. STAT LIVE OPTIONS
  90. -----------------
  91. -d::
  92. --display::
  93. Time in seconds between display updates
  94. -m::
  95. --mmap-pages=::
  96. Number of mmap data pages. Must be a power of two.
  97. -a::
  98. --all-cpus::
  99. System-wide collection from all CPUs.
  100. -p::
  101. --pid=::
  102. Analyze events only for given process ID(s) (comma separated list).
  103. --vcpu=<value>::
  104. analyze events which occures on this vcpu. (default: all vcpus)
  105. --event=<value>::
  106. event to be analyzed. Possible values: vmexit, mmio, ioport.
  107. (default: vmexit)
  108. -k::
  109. --key=<value>::
  110. Sorting key. Possible values: sample (default, sort by samples
  111. number), time (sort by average time).
  112. --duration=<value>::
  113. Show events other than HLT that take longer than duration usecs.
  114. SEE ALSO
  115. --------
  116. linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],
  117. linkperf:perf-diff[1], linkperf:perf-buildid-list[1],
  118. linkperf:perf-stat[1]