1PERF-KVM(1) perf Manual PERF-KVM(1)
2
3
4
6 perf-kvm - Tool to trace/measure kvm guest os
7
9 perf kvm [--host] [--guest] [--guestmount=<path>
10 [--guestkallsyms=<path> --guestmodules=<path> | --guestvmlinux=<path>]]
11 {top|record|report|diff|buildid-list} [<options>]
12 perf kvm [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path>
13 | --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat} [<options>]
14 'perf kvm stat [record|report|live] [<options>]
15
17 There are a couple of variants of perf kvm:
18
19 'perf kvm [options] top <command>' to generates and displays
20 a performance counter profile of guest os in realtime
21 of an arbitrary workload.
22
23 'perf kvm record <command>' to record the performance counter profile
24 of an arbitrary workload and save it into a perf data file. We set the
25 default behavior of perf kvm as --guest, so if neither --host nor --guest
26 is input, the perf data file name is perf.data.guest. If --host is input,
27 the perf data file name is perf.data.kvm. If you want to record data into
28 perf.data.host, please input --host --no-guest. The behaviors are shown as
29 following:
30 Default('') -> perf.data.guest
31 --host -> perf.data.kvm
32 --guest -> perf.data.guest
33 --host --guest -> perf.data.kvm
34 --host --no-guest -> perf.data.host
35
36 'perf kvm report' to display the performance counter profile information
37 recorded via perf kvm record.
38
39 'perf kvm diff' to displays the performance difference amongst two perf.data
40 files captured via perf record.
41
42 'perf kvm buildid-list' to display the buildids found in a perf data file,
43 so that other tools can be used to fetch packages with matching symbol tables
44 for use by perf report. As buildid is read from /sys/kernel/notes in os, then
45 if you want to list the buildid for guest, please make sure your perf data file
46 was captured with --guestmount in perf kvm record.
47
48 'perf kvm stat <command>' to run a command and gather performance counter
49 statistics.
50 Especially, perf 'kvm stat record/report' generates a statistical analysis
51 of KVM events. Currently, vmexit, mmio (x86 only) and ioport (x86 only)
52 events are supported. 'perf kvm stat record <command>' records kvm events
53 and the events between start and end <command>.
54 And this command produces a file which contains tracing results of kvm
55 events.
56
57 'perf kvm stat report' reports statistical data which includes events
58 handled time, samples, and so on.
59
60 'perf kvm stat live' reports statistical data in a live mode (similar to
61 record + report but with statistical data updated live at a given display
62 rate).
63
65 -i, --input=<path>
66 Input file name.
67
68 -o, --output=<path>
69 Output file name.
70
71 --host
72 Collect host side performance profile.
73
74 --guest
75 Collect guest side performance profile.
76
77 --guestmount=<path>
78 Guest os root file system mount directory. Users mounts guest os
79 root directories under <path> by a specific filesystem access
80 method, typically, sshfs. For example, start 2 guest os. The one’s
81 pid is 8888 and the other’s is 9999. #mkdir /guestmount;
82 cd/guestmount #sshfs -o allow_other,direct_io -p 5551 localhost:/
83 8888/ #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
84 #perf kvm --host --guest --guestmount=~/guestmount top
85
86 --guestkallsyms=<path>
87 Guest os /proc/kallsyms file copy. perf kvm' reads it to get guest
88 kernel symbols. Users copy it out from guest os.
89
90 --guestmodules=<path>
91 Guest os /proc/modules file copy. perf kvm' reads it to get guest
92 kernel module information. Users copy it out from guest os.
93
94 --guestvmlinux=<path>
95 Guest os kernel vmlinux.
96
97 -v, --verbose
98 Be more verbose (show counter open errors, etc).
99
101 --vcpu=<value>
102 analyze events which occur on this vcpu. (default: all vcpus)
103
104 --event=<value>
105 event to be analyzed. Possible values: vmexit, mmio (x86 only),
106 ioport (x86 only). (default: vmexit)
107
108 -k, --key=<value>
109 Sorting key. Possible values: sample (default, sort by samples
110 number), time (sort by average time).
111
112 -p, --pid=
113 Analyze events only for given process ID(s) (comma separated list).
114
116 -d, --display
117 Time in seconds between display updates
118
119 -m, --mmap-pages=
120 Number of mmap data pages (must be a power of two) or size
121 specification with appended unit character - B/K/M/G. The size is
122 rounded up to have nearest pages power of two value.
123
124 -a, --all-cpus
125 System-wide collection from all CPUs.
126
127 -p, --pid=
128 Analyze events only for given process ID(s) (comma separated list).
129
130 --vcpu=<value>
131 analyze events which occur on this vcpu. (default: all vcpus)
132
133 --event=<value>
134 event to be analyzed. Possible values: vmexit, mmio (x86 only),
135 ioport (x86 only). (default: vmexit)
136
137 -k, --key=<value>
138 Sorting key. Possible values: sample (default, sort by samples
139 number), time (sort by average time).
140
141 --duration=<value>
142 Show events other than HLT (x86 only) or Wait state (s390 only)
143 that take longer than duration usecs.
144
145 --proc-map-timeout
146 When processing pre-existing threads /proc/XXX/mmap, it may take a
147 long time, because the file may be huge. A time out is needed in
148 such cases. This option sets the time out limit. The default value
149 is 500 ms.
150
152 perf-top(1), perf-record(1), perf-report(1), perf-diff(1), perf-
153 buildid-list(1), perf-stat(1)
154
155
156
157perf 06/03/2019 PERF-KVM(1)