blob: 96a9a1dea727936789897544d38016f26018120b [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
Dongsheng Yang8df0b4a2013-12-04 17:56:41 -050027 of an arbitrary workload and save it into a perf data file. We set the
28 default behavior of perf kvm as --guest, so if neither --host nor --guest
29 is input, the perf data file name is perf.data.guest. If --host is input,
30 the perf data file name is perf.data.kvm. If you want to record data into
31 perf.data.host, please input --host --no-guest. The behaviors are shown as
32 following:
33 Default('') -> perf.data.guest
34 --host -> perf.data.kvm
35 --guest -> perf.data.guest
36 --host --guest -> perf.data.kvm
37 --host --no-guest -> perf.data.host
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080038
39 'perf kvm report' to display the performance counter profile information
40 recorded via perf kvm record.
41
42 'perf kvm diff' to displays the performance difference amongst two perf.data
43 files captured via perf record.
44
45 'perf kvm buildid-list' to display the buildids found in a perf data file,
46 so that other tools can be used to fetch packages with matching symbol tables
Dongsheng Yanged086d52013-12-04 17:56:42 -050047 for use by perf report. As buildid is read from /sys/kernel/notes in os, then
48 if you want to list the buildid for guest, please make sure your perf data file
49 was captured with --guestmount in perf kvm record.
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080050
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +080051 'perf kvm stat <command>' to run a command and gather performance counter
52 statistics.
53 Especially, perf 'kvm stat record/report' generates a statistical analysis
54 of KVM events. Currently, vmexit, mmio and ioport events are supported.
55 'perf kvm stat record <command>' records kvm events and the events between
56 start and end <command>.
57 And this command produces a file which contains tracing results of kvm
58 events.
59
60 'perf kvm stat report' reports statistical data which includes events
61 handled time, samples, and so on.
62
David Ahern9a6d3162013-08-07 21:56:39 -040063 'perf kvm stat live' reports statistical data in a live mode (similar to
64 record + report but with statistical data updated live at a given display
65 rate).
66
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080067OPTIONS
68-------
Shawn Bohrer5c0ef0a2010-11-30 19:57:13 -060069-i::
Dongsheng Yang316bd982013-12-04 17:56:43 -050070--input=<path>::
Shawn Bohrer5c0ef0a2010-11-30 19:57:13 -060071 Input file name.
72-o::
Dongsheng Yang316bd982013-12-04 17:56:43 -050073--output=<path>::
Shawn Bohrer5c0ef0a2010-11-30 19:57:13 -060074 Output file name.
Dongsheng Yang316bd982013-12-04 17:56:43 -050075--host::
William Cohencfadf9d2010-04-23 16:36:21 -040076 Collect host side performance profile.
Dongsheng Yang316bd982013-12-04 17:56:43 -050077--guest::
William Cohencfadf9d2010-04-23 16:36:21 -040078 Collect guest side performance profile.
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080079--guestmount=<path>::
80 Guest os root file system mount directory. Users mounts guest os
81 root directories under <path> by a specific filesystem access method,
82 typically, sshfs. For example, start 2 guest os. The one's pid is 8888
83 and the other's is 9999.
84 #mkdir ~/guestmount; cd ~/guestmount
85 #sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
86 #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
87 #perf kvm --host --guest --guestmount=~/guestmount top
88--guestkallsyms=<path>::
89 Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get guest
90 kernel symbols. Users copy it out from guest os.
91--guestmodules=<path>::
92 Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest
93 kernel module information. Users copy it out from guest os.
94--guestvmlinux=<path>::
95 Guest os kernel vmlinux.
96
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +080097STAT REPORT OPTIONS
98-------------------
99--vcpu=<value>::
100 analyze events which occures on this vcpu. (default: all vcpus)
101
David Ahern9a6d3162013-08-07 21:56:39 -0400102--event=<value>::
103 event to be analyzed. Possible values: vmexit, mmio, ioport.
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +0800104 (default: vmexit)
105-k::
106--key=<value>::
107 Sorting key. Possible values: sample (default, sort by samples
108 number), time (sort by average time).
David Ahern9a6d3162013-08-07 21:56:39 -0400109-p::
110--pid=::
111 Analyze events only for given process ID(s) (comma separated list).
112
113STAT LIVE OPTIONS
114-----------------
115-d::
116--display::
117 Time in seconds between display updates
118
119-m::
120--mmap-pages=::
Jiri Olsa27050f52013-09-01 12:36:13 +0200121 Number of mmap data pages (must be a power of two) or size
122 specification with appended unit character - B/K/M/G. The
123 size is rounded up to have nearest pages power of two value.
David Ahern9a6d3162013-08-07 21:56:39 -0400124
125-a::
126--all-cpus::
127 System-wide collection from all CPUs.
128
129-p::
130--pid=::
131 Analyze events only for given process ID(s) (comma separated list).
132
133--vcpu=<value>::
134 analyze events which occures on this vcpu. (default: all vcpus)
135
136
137--event=<value>::
138 event to be analyzed. Possible values: vmexit, mmio, ioport.
139 (default: vmexit)
140
141-k::
142--key=<value>::
143 Sorting key. Possible values: sample (default, sort by samples
144 number), time (sort by average time).
145
146--duration=<value>::
147 Show events other than HLT that take longer than duration usecs.
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +0800148
Zhang, Yanmina1645ce2010-04-19 13:32:50 +0800149SEE ALSO
150--------
William Cohencfadf9d2010-04-23 16:36:21 -0400151linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],
Xiao Guangrongbcf6edc2012-09-17 16:31:15 +0800152linkperf:perf-diff[1], linkperf:perf-buildid-list[1],
153linkperf:perf-stat[1]