blob: ac84db2d23342aaa269255e34c9ab3f5d70a3e4f [file] [log] [blame]
Zhang, Yanmina1645ce2010-04-19 13:32:50 +08001perf-kvm(1)
William Cohencfadf9d2010-04-23 16:36:21 -04002===========
Zhang, Yanmina1645ce2010-04-19 13:32:50 +08003
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>
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +080015 | --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat}
David Ahern9a6d3162013-08-07 21:56:39 -040016'perf kvm stat [record|report|live] [<options>]
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080017
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
Shawn Bohrer5c0ef0a2010-11-30 19:57:13 -060026 'perf kvm record <command>' to record the performance counter profile
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080027 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
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +080042 '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
David Ahern9a6d3162013-08-07 21:56:39 -040054 '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
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080058OPTIONS
59-------
Shawn Bohrer5c0ef0a2010-11-30 19:57:13 -060060-i::
61--input=::
62 Input file name.
63-o::
64--output::
65 Output file name.
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080066--host=::
William Cohencfadf9d2010-04-23 16:36:21 -040067 Collect host side performance profile.
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080068--guest=::
William Cohencfadf9d2010-04-23 16:36:21 -040069 Collect guest side performance profile.
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080070--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
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +080088STAT REPORT OPTIONS
89-------------------
90--vcpu=<value>::
91 analyze events which occures on this vcpu. (default: all vcpus)
92
David Ahern9a6d3162013-08-07 21:56:39 -040093--event=<value>::
94 event to be analyzed. Possible values: vmexit, mmio, ioport.
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +080095 (default: vmexit)
96-k::
97--key=<value>::
98 Sorting key. Possible values: sample (default, sort by samples
99 number), time (sort by average time).
David Ahern9a6d3162013-08-07 21:56:39 -0400100-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.
113
114-a::
115--all-cpus::
116 System-wide collection from all CPUs.
117
118-p::
119--pid=::
120 Analyze events only for given process ID(s) (comma separated list).
121
122--vcpu=<value>::
123 analyze events which occures on this vcpu. (default: all vcpus)
124
125
126--event=<value>::
127 event to be analyzed. Possible values: vmexit, mmio, ioport.
128 (default: vmexit)
129
130-k::
131--key=<value>::
132 Sorting key. Possible values: sample (default, sort by samples
133 number), time (sort by average time).
134
135--duration=<value>::
136 Show events other than HLT that take longer than duration usecs.
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +0800137
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800138SEE ALSO
139--------
William Cohencfadf9d2010-04-23 16:36:21 -0400140linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +0800141linkperf:perf-diff[1], linkperf:perf-buildid-list[1],
142linkperf:perf-stat[1]