xref: /OK3568_Linux_fs/kernel/tools/kvm/kvm_stat/kvm_stat.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunkvm_stat(1)
2*4882a593Smuzhiyun===========
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunNAME
5*4882a593Smuzhiyun----
6*4882a593Smuzhiyunkvm_stat - Report KVM kernel module event counters
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunSYNOPSIS
9*4882a593Smuzhiyun--------
10*4882a593Smuzhiyun[verse]
11*4882a593Smuzhiyun'kvm_stat' [OPTION]...
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunDESCRIPTION
14*4882a593Smuzhiyun-----------
15*4882a593Smuzhiyunkvm_stat prints counts of KVM kernel module trace events.  These events signify
16*4882a593Smuzhiyunstate transitions such as guest mode entry and exit.
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunThis tool is useful for observing guest behavior from the host perspective.
19*4882a593SmuzhiyunOften conclusions about performance or buggy behavior can be drawn from the
20*4882a593Smuzhiyunoutput.
21*4882a593SmuzhiyunWhile running in regular mode, use any of the keys listed in section
22*4882a593Smuzhiyun'Interactive Commands' below.
23*4882a593SmuzhiyunUse batch and logging modes for scripting purposes.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunThe set of KVM kernel module trace events may be specific to the kernel version
26*4882a593Smuzhiyunor architecture.  It is best to check the KVM kernel module source code for the
27*4882a593Smuzhiyunmeaning of events.
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunINTERACTIVE COMMANDS
30*4882a593Smuzhiyun--------------------
31*4882a593Smuzhiyun[horizontal]
32*4882a593Smuzhiyun*b*::	toggle events by guests (debugfs only, honors filters)
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun*c*::	clear filter
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun*f*::	filter by regular expression
37*4882a593Smuzhiyun ::     *Note*: Child events pull in their parents, and parents' stats summarize
38*4882a593Smuzhiyun                all child events, not just the filtered ones
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun*g*::	filter by guest name/PID
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun*h*::	display interactive commands reference
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun*o*::   toggle sorting order (Total vs CurAvg/s)
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun*p*::	filter by guest name/PID
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun*q*::	quit
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun*r*::	reset stats
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun*s*::   set delay between refreshs
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun*x*::	toggle reporting of stats for child trace events
55*4882a593Smuzhiyun ::     *Note*: The stats for the parents summarize the respective child trace
56*4882a593Smuzhiyun                events
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunPress any other key to refresh statistics immediately.
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunOPTIONS
61*4882a593Smuzhiyun-------
62*4882a593Smuzhiyun-1::
63*4882a593Smuzhiyun--once::
64*4882a593Smuzhiyun--batch::
65*4882a593Smuzhiyun	run in batch mode for one second
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun-c::
68*4882a593Smuzhiyun--csv::
69*4882a593Smuzhiyun        log in csv format. Requires option -l/--log or -L/--log-to-file.
70*4882a593Smuzhiyun        When used with option -L/--log-to-file, the header is only ever
71*4882a593Smuzhiyun        written to start of file to preserve the format.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun-d::
74*4882a593Smuzhiyun--debugfs::
75*4882a593Smuzhiyun	retrieve statistics from debugfs
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun-f<fields>::
78*4882a593Smuzhiyun--fields=<fields>::
79*4882a593Smuzhiyun        fields to display (regex), "-f help" for a list of available events
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun-g<guest>::
82*4882a593Smuzhiyun--guest=<guest_name>::
83*4882a593Smuzhiyun        limit statistics to one virtual machine (guest name)
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun-h::
86*4882a593Smuzhiyun--help::
87*4882a593Smuzhiyun        show help message
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun-i::
90*4882a593Smuzhiyun--debugfs-include-past::
91*4882a593Smuzhiyun	include all available data on past events for debugfs
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun-l::
94*4882a593Smuzhiyun--log::
95*4882a593Smuzhiyun        run in logging mode (like vmstat)
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun-L<file>::
99*4882a593Smuzhiyun--log-to-file=<file>::
100*4882a593Smuzhiyun        like -l/--log, but logging to a file. Appends to existing files.
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun-p<pid>::
103*4882a593Smuzhiyun--pid=<pid>::
104*4882a593Smuzhiyun	limit statistics to one virtual machine (pid)
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun-s::
107*4882a593Smuzhiyun--set-delay::
108*4882a593Smuzhiyun        set delay between refreshs (value range: 0.1-25.5 secs)
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun-t::
111*4882a593Smuzhiyun--tracepoints::
112*4882a593Smuzhiyun        retrieve statistics from tracepoints
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun*z*::
115*4882a593Smuzhiyun--skip-zero-records::
116*4882a593Smuzhiyun        omit records with all zeros in logging mode
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunSEE ALSO
119*4882a593Smuzhiyun--------
120*4882a593Smuzhiyun'perf'(1), 'trace-cmd'(1)
121*4882a593Smuzhiyun
122*4882a593SmuzhiyunAUTHOR
123*4882a593Smuzhiyun------
124*4882a593SmuzhiyunStefan Hajnoczi <stefanha@redhat.com>
125