summaryrefslogtreecommitdiff
path: root/tools/perf/Documentation/perf-kvm.txt
blob: b66be66fe836ad965adc38fdc8a6f9df98233797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
perf-kvm(1)
===========

NAME
----
perf-kvm - Tool to trace/measure kvm guest os

SYNOPSIS
--------
[verse]
'perf kvm' [--host] [--guest] [--guestmount=<path>
	[--guestkallsyms=<path> --guestmodules=<path> | --guestvmlinux=<path>]]
	{top|record|report|diff|buildid-list} [<options>]
'perf kvm' [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path>
	| --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat} [<options>]
'perf kvm stat [record|report|live] [<options>]

DESCRIPTION
-----------
There are a couple of variants of perf kvm:

  'perf kvm [options] top <command>' to generates and displays
  a performance counter profile of guest os in realtime
  of an arbitrary workload.

  'perf kvm record <command>' to record the performance counter profile
  of an arbitrary workload and save it into a perf data file. We set the
  default behavior of perf kvm as --guest, so if neither --host nor --guest
  is input, the perf data file name is perf.data.guest. If --host is input,
  the perf data file name is perf.data.kvm. If you want to record data into
  perf.data.host, please input --host --no-guest. The behaviors are shown as
  following:
    Default('')         ->  perf.data.guest
    --host              ->  perf.data.kvm
    --guest             ->  perf.data.guest
    --host --guest      ->  perf.data.kvm
    --host --no-guest   ->  perf.data.host

  'perf kvm report' to display the performance counter profile information
  recorded via perf kvm record.

  'perf kvm diff' to displays the performance difference amongst two perf.data
  files captured via perf record.

  'perf kvm buildid-list' to  display the buildids found in a perf data file,
  so that other tools can be used to fetch packages with matching symbol tables
  for use by perf report. As buildid is read from /sys/kernel/notes in os, then
  if you want to list the buildid for guest, please make sure your perf data file
  was captured with --guestmount in perf kvm record.

  'perf kvm stat <command>' to run a command and gather performance counter
  statistics.
  Especially, perf 'kvm stat record/report' generates a statistical analysis
  of KVM events. Currently, vmexit, mmio (x86 only) and ioport (x86 only)
  events are supported. 'perf kvm stat record <command>' records kvm events
  and the events between start and end <command>.
  And this command produces a file which contains tracing results of kvm
  events.

  'perf kvm stat report' reports statistical data which includes events
  handled sample, percent_sample, time, percent_time, max_t, min_t, mean_t.

  'perf kvm stat live' reports statistical data in a live mode (similar to
  record + report but with statistical data updated live at a given display
  rate).

OPTIONS
-------
-i::
--input=<path>::
        Input file name, for the 'report', 'diff' and 'buildid-list' subcommands.
-o::
--output=<path>::
        Output file name, for the 'record' subcommand. Doesn't work with 'report',
        just redirect the output to a file when using 'report'.
--host::
        Collect host side performance profile.
--guest::
        Collect guest side performance profile.

:GMEXAMPLECMD: kvm --host --guest
:GMEXAMPLESUBCMD: top
include::guest-files.txt[]

--stdio:: Use the stdio interface.

-v::
--verbose::
	Be more verbose (show counter open errors, etc).

STAT REPORT OPTIONS
-------------------
--vcpu=<value>::
       analyze events which occur on this vcpu. (default: all vcpus)

--event=<value>::
       event to be analyzed. Possible values: vmexit, mmio (x86 only),
       ioport (x86 only). (default: vmexit)
-k::
--key=<value>::
       Sorting key. Possible values: sample (default, sort by samples
       number), percent_sample (sort by sample percentage), time
       (sort by average time), precent_time (sort by time percentage),
       max_t (sort by maximum time), min_t (sort by minimum time), mean_t
       (sort by mean time).
-p::
--pid=::
    Analyze events only for given process ID(s) (comma separated list).

STAT LIVE OPTIONS
-----------------
-d::
--display::
        Time in seconds between display updates

-m::
--mmap-pages=::
    Number of mmap data pages (must be a power of two) or size
    specification with appended unit character - B/K/M/G. The
    size is rounded up to have nearest pages power of two value.

-a::
--all-cpus::
        System-wide collection from all CPUs.

-p::
--pid=::
    Analyze events only for given process ID(s) (comma separated list).

--vcpu=<value>::
       analyze events which occur on this vcpu. (default: all vcpus)


--event=<value>::
       event to be analyzed. Possible values: vmexit,
       mmio (x86 only), ioport (x86 only).
       (default: vmexit)

-k::
--key=<value>::
       Sorting key. Possible values: sample (default, sort by samples
       number), time (sort by average time).

--duration=<value>::
       Show events other than HLT (x86 only) or Wait state (s390 only)
       that take longer than duration usecs.

--proc-map-timeout::
	When processing pre-existing threads /proc/XXX/mmap, it may take
	a long time, because the file may be huge. A time out is needed
	in such cases.
	This option sets the time out limit. The default value is 500 ms.

SEE ALSO
--------
linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],
linkperf:perf-diff[1], linkperf:perf-buildid-list[1],
linkperf:perf-stat[1]