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