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 sample, percent_sample, time, percent_time, max_t, min_t, mean_t.
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 mount guest OS
80           root directories under <path> by a specific filesystem access
81           method, typically, sshfs. For example, start 2 guest OS, one’s pid
82           is 8888 and the other’s is 9999:
83
84               $ mkdir ~/guestmount
85               $ cd ~/guestmount
86               $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
87               $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
88               $ perf kvm --host --guest --guestmount=~/guestmount top
89
90       --guestkallsyms=<path>
91           Guest OS /proc/kallsyms file copy. perf reads it to get guest
92           kernel symbols. Users copy it out from guest OS.
93
94       --guestmodules=<path>
95           Guest OS /proc/modules file copy. perf reads it to get guest kernel
96           module information. Users copy it out from guest OS.
97
98       --guestvmlinux=<path>
99           Guest OS kernel vmlinux.
100
101       --guest-code
102           Indicate that guest code can be found in the hypervisor process,
103           which is a common case for KVM test programs.
104
105       --stdio
106           Use the stdio interface.
107
108       -v, --verbose
109           Be more verbose (show counter open errors, etc).
110

STAT REPORT OPTIONS

112       --vcpu=<value>
113           analyze events which occur on this vcpu. (default: all vcpus)
114
115       --event=<value>
116           event to be analyzed. Possible values: vmexit, mmio (x86 only),
117           ioport (x86 only). (default: vmexit)
118
119       -k, --key=<value>
120           Sorting key. Possible values: sample (default, sort by samples
121           number), percent_sample (sort by sample percentage), time (sort by
122           average time), precent_time (sort by time percentage), max_t (sort
123           by maximum time), min_t (sort by minimum time), mean_t (sort by
124           mean time).
125
126       -p, --pid=
127           Analyze events only for given process ID(s) (comma separated list).
128

STAT LIVE OPTIONS

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

SEE ALSO

166       perf-top(1), perf-record(1), perf-report(1), perf-diff(1), perf-
167       buildid-list(1), perf-stat(1)
168
169
170
171perf                              11/28/2023                       PERF-KVM(1)
Impressum