1PERF-KVM(1)                       perf Manual                      PERF-KVM(1)
2
3
4

NAME

6       perf-kvm - Tool to trace/measure kvm guest os
7

SYNOPSIS

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

DESCRIPTION

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

OPTIONS

65       -i, --input=<path>
66           Input file name, for the report, diff and buildid-list subcommands.
67
68       -o, --output=<path>
69           Output file name, for the record subcommand. Doesn’t work with
70           report, just redirect the output to a file when using report.
71
72       --host
73           Collect host side performance profile.
74
75       --guest
76           Collect guest side performance profile.
77
78       --guestmount=<path>
79           Guest os root file system mount directory. Users mounts guest os
80           root directories under <path> by a specific filesystem access
81           method, typically, sshfs. For example, start 2 guest os. The one’s
82           pid is 8888 and the other’s is 9999. #mkdir /guestmount;
83           cd/guestmount #sshfs -o allow_other,direct_io -p 5551 localhost:/
84           8888/ #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
85           #perf kvm --host --guest --guestmount=~/guestmount top
86
87       --guestkallsyms=<path>
88           Guest os /proc/kallsyms file copy.  perf kvm' reads it to get guest
89           kernel symbols. Users copy it out from guest os.
90
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
95       --guestvmlinux=<path>
96           Guest os kernel vmlinux.
97
98       -v, --verbose
99           Be more verbose (show counter open errors, etc).
100

STAT REPORT OPTIONS

102       --vcpu=<value>
103           analyze events which occur on this vcpu. (default: all vcpus)
104
105       --event=<value>
106           event to be analyzed. Possible values: vmexit, mmio (x86 only),
107           ioport (x86 only). (default: vmexit)
108
109       -k, --key=<value>
110           Sorting key. Possible values: sample (default, sort by samples
111           number), time (sort by average time).
112
113       -p, --pid=
114           Analyze events only for given process ID(s) (comma separated list).
115

STAT LIVE OPTIONS

117       -d, --display
118           Time in seconds between display updates
119
120       -m, --mmap-pages=
121           Number of mmap data pages (must be a power of two) or size
122           specification with appended unit character - B/K/M/G. The size is
123           rounded up to have nearest pages power of two value.
124
125       -a, --all-cpus
126           System-wide collection from all CPUs.
127
128       -p, --pid=
129           Analyze events only for given process ID(s) (comma separated list).
130
131       --vcpu=<value>
132           analyze events which occur on this vcpu. (default: all vcpus)
133
134       --event=<value>
135           event to be analyzed. Possible values: vmexit, mmio (x86 only),
136           ioport (x86 only). (default: vmexit)
137
138       -k, --key=<value>
139           Sorting key. Possible values: sample (default, sort by samples
140           number), time (sort by average time).
141
142       --duration=<value>
143           Show events other than HLT (x86 only) or Wait state (s390 only)
144           that take longer than duration usecs.
145
146       --proc-map-timeout
147           When processing pre-existing threads /proc/XXX/mmap, it may take a
148           long time, because the file may be huge. A time out is needed in
149           such cases. This option sets the time out limit. The default value
150           is 500 ms.
151

SEE ALSO

153       perf-top(1), perf-record(1), perf-report(1), perf-diff(1), perf-
154       buildid-list(1), perf-stat(1)
155
156
157
158perf                              06/03/2021                       PERF-KVM(1)
Impressum