blob: feaf46451e838dab520da542cb823eddd107578b [file] [log] [blame]
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02001kvm_stat(1)
2===========
3
4NAME
5----
6kvm_stat - Report KVM kernel module event counters
7
8SYNOPSIS
9--------
10[verse]
11'kvm_stat' [OPTION]...
12
13DESCRIPTION
14-----------
15kvm_stat prints counts of KVM kernel module trace events. These events signify
16state transitions such as guest mode entry and exit.
17
18This tool is useful for observing guest behavior from the host perspective.
19Often conclusions about performance or buggy behavior can be drawn from the
20output.
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010021While running in regular mode, use any of the keys listed in section
22'Interactive Commands' below.
23Use batch and logging modes for scripting purposes.
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +020024
25The set of KVM kernel module trace events may be specific to the kernel version
26or architecture. It is best to check the KVM kernel module source code for the
27meaning of events.
28
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010029INTERACTIVE COMMANDS
30--------------------
31[horizontal]
Stefan Raspl5c1954d252017-06-25 21:34:16 +020032*b*:: toggle events by guests (debugfs only, honors filters)
33
Stefan Raspl44430842017-03-10 13:40:14 +010034*c*:: clear filter
35
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010036*f*:: filter by regular expression
Stefan Raspl883d25e72019-04-21 15:26:24 +020037 :: *Note*: Child events pull in their parents, and parents' stats summarize
38 all child events, not just the filtered ones
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010039
Stefan Raspl516f1192018-02-22 12:16:27 +010040*g*:: filter by guest name/PID
Stefan Rasplf9ff1082017-03-10 13:40:13 +010041
Stefan Raspl1fdea7b2017-06-07 21:08:38 +020042*h*:: display interactive commands reference
43
Stefan Raspl6667ae82017-06-07 21:08:41 +020044*o*:: toggle sorting order (Total vs CurAvg/s)
45
Stefan Raspl516f1192018-02-22 12:16:27 +010046*p*:: filter by guest name/PID
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010047
48*q*:: quit
49
Stefan Raspl9f114a02017-03-10 13:40:15 +010050*r*:: reset stats
51
Stefan Raspleecda7a2020-03-06 12:42:44 +010052*s*:: set delay between refreshs
Stefan Raspl64eefad2017-06-07 21:08:39 +020053
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010054*x*:: toggle reporting of stats for child trace events
Stefan Rasplfff8c9e2017-12-11 12:25:23 +010055 :: *Note*: The stats for the parents summarize the respective child trace
56 events
Stefan Raspl1eaa2f92017-03-10 13:40:07 +010057
58Press any other key to refresh statistics immediately.
59
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +020060OPTIONS
61-------
62-1::
63--once::
64--batch::
65 run in batch mode for one second
66
Stefan Raspl0c794dc2020-03-06 12:42:47 +010067-c::
Stefan Raspl3754afe72020-04-02 10:57:04 +020068--csv::
69 log in csv format. Requires option -l/--log or -L/--log-to-file.
70 When used with option -L/--log-to-file, the header is only ever
71 written to start of file to preserve the format.
Stefan Raspl0c794dc2020-03-06 12:42:47 +010072
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +020073-d::
74--debugfs::
75 retrieve statistics from debugfs
76
Stefan Raspleecda7a2020-03-06 12:42:44 +010077-f<fields>::
78--fields=<fields>::
79 fields to display (regex), "-f help" for a list of available events
80
81-g<guest>::
82--guest=<guest_name>::
83 limit statistics to one virtual machine (guest name)
84
85-h::
86--help::
87 show help message
88
Stefan Rasplab7ef192017-06-25 21:34:15 +020089-i::
90--debugfs-include-past::
91 include all available data on past events for debugfs
92
Stefan Raspleecda7a2020-03-06 12:42:44 +010093-l::
94--log::
95 run in logging mode (like vmstat)
96
Stefan Raspl3754afe72020-04-02 10:57:04 +020097
98-L<file>::
99--log-to-file=<file>::
100 like -l/--log, but logging to a file. Appends to existing files.
101
Janosch Frankf0cf0402016-05-18 13:26:24 +0200102-p<pid>::
103--pid=<pid>::
104 limit statistics to one virtual machine (pid)
105
Stefan Raspl3cbb3942020-03-06 12:42:46 +0100106-s::
107--set-delay::
108 set delay between refreshs (value range: 0.1-25.5 secs)
109
Stefan Raspleecda7a2020-03-06 12:42:44 +0100110-t::
111--tracepoints::
112 retrieve statistics from tracepoints
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +0200113
Stefan Rasplda1fda282020-04-02 10:57:03 +0200114*z*::
115--skip-zero-records::
116 omit records with all zeros in logging mode
117
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +0200118SEE ALSO
119--------
120'perf'(1), 'trace-cmd'(1)
121
122AUTHOR
123------
124Stefan Hajnoczi <stefanha@redhat.com>