Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 1 | perf-kvm(1) |
William Cohen | cfadf9d | 2010-04-23 16:36:21 -0400 | [diff] [blame] | 2 | =========== |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | perf-kvm - Tool to trace/measure kvm guest os |
| 7 | |
| 8 | SYNOPSIS |
| 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> |
Xiao Guangrong | bcf6edc | 2012-09-17 16:31:15 +0800 | [diff] [blame] | 15 | | --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat} |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 16 | |
| 17 | DESCRIPTION |
| 18 | ----------- |
| 19 | There are a couple of variants of perf kvm: |
| 20 | |
| 21 | 'perf kvm [options] top <command>' to generates and displays |
| 22 | a performance counter profile of guest os in realtime |
| 23 | of an arbitrary workload. |
| 24 | |
Shawn Bohrer | 5c0ef0a | 2010-11-30 19:57:13 -0600 | [diff] [blame] | 25 | 'perf kvm record <command>' to record the performance counter profile |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 26 | of an arbitrary workload and save it into a perf data file. If both |
| 27 | --host and --guest are input, the perf data file name is perf.data.kvm. |
| 28 | If there is no --host but --guest, the file name is perf.data.guest. |
| 29 | If there is no --guest but --host, the file name is perf.data.host. |
| 30 | |
| 31 | 'perf kvm report' to display the performance counter profile information |
| 32 | recorded via perf kvm record. |
| 33 | |
| 34 | 'perf kvm diff' to displays the performance difference amongst two perf.data |
| 35 | files captured via perf record. |
| 36 | |
| 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. |
| 40 | |
Xiao Guangrong | bcf6edc | 2012-09-17 16:31:15 +0800 | [diff] [blame] | 41 | 'perf kvm stat <command>' to run a command and gather performance counter |
| 42 | statistics. |
| 43 | Especially, perf 'kvm stat record/report' generates a statistical analysis |
| 44 | of KVM events. Currently, vmexit, mmio and ioport events are supported. |
| 45 | 'perf kvm stat record <command>' records kvm events and the events between |
| 46 | start and end <command>. |
| 47 | And this command produces a file which contains tracing results of kvm |
| 48 | events. |
| 49 | |
| 50 | 'perf kvm stat report' reports statistical data which includes events |
| 51 | handled time, samples, and so on. |
| 52 | |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 53 | OPTIONS |
| 54 | ------- |
Shawn Bohrer | 5c0ef0a | 2010-11-30 19:57:13 -0600 | [diff] [blame] | 55 | -i:: |
| 56 | --input=:: |
| 57 | Input file name. |
| 58 | -o:: |
| 59 | --output:: |
| 60 | Output file name. |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 61 | --host=:: |
William Cohen | cfadf9d | 2010-04-23 16:36:21 -0400 | [diff] [blame] | 62 | Collect host side performance profile. |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 63 | --guest=:: |
William Cohen | cfadf9d | 2010-04-23 16:36:21 -0400 | [diff] [blame] | 64 | Collect guest side performance profile. |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 65 | --guestmount=<path>:: |
| 66 | Guest os root file system mount directory. Users mounts guest os |
| 67 | root directories under <path> by a specific filesystem access method, |
| 68 | typically, sshfs. For example, start 2 guest os. The one's pid is 8888 |
| 69 | and the other's is 9999. |
| 70 | #mkdir ~/guestmount; cd ~/guestmount |
| 71 | #sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/ |
| 72 | #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/ |
| 73 | #perf kvm --host --guest --guestmount=~/guestmount top |
| 74 | --guestkallsyms=<path>:: |
| 75 | Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get guest |
| 76 | kernel symbols. Users copy it out from guest os. |
| 77 | --guestmodules=<path>:: |
| 78 | Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest |
| 79 | kernel module information. Users copy it out from guest os. |
| 80 | --guestvmlinux=<path>:: |
| 81 | Guest os kernel vmlinux. |
| 82 | |
Xiao Guangrong | bcf6edc | 2012-09-17 16:31:15 +0800 | [diff] [blame] | 83 | STAT REPORT OPTIONS |
| 84 | ------------------- |
| 85 | --vcpu=<value>:: |
| 86 | analyze events which occures on this vcpu. (default: all vcpus) |
| 87 | |
| 88 | --events=<value>:: |
| 89 | events to be analyzed. Possible values: vmexit, mmio, ioport. |
| 90 | (default: vmexit) |
| 91 | -k:: |
| 92 | --key=<value>:: |
| 93 | Sorting key. Possible values: sample (default, sort by samples |
| 94 | number), time (sort by average time). |
| 95 | |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 96 | SEE ALSO |
| 97 | -------- |
William Cohen | cfadf9d | 2010-04-23 16:36:21 -0400 | [diff] [blame] | 98 | linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1], |
Xiao Guangrong | bcf6edc | 2012-09-17 16:31:15 +0800 | [diff] [blame] | 99 | linkperf:perf-diff[1], linkperf:perf-buildid-list[1], |
| 100 | linkperf:perf-stat[1] |