Skip to content

Commit eecda7a

Browse files
Stefan Rasplbonzini
Stefan Raspl
authored andcommitted
tools/kvm_stat: rework command line sequence and message texts
Make sure command line arguments are sorted alphabetically everywhere, and adjusted existing texts for interactive command 's' to become consistent with the long form --set-delay. Throwing in some PEP8 fixes (all cosmetics) for good measure. Signed-off-by: Stefan Raspl <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent bfcaa84 commit eecda7a

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

tools/kvm/kvm_stat/kvm_stat

+5-4
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ class Tui(object):
11831183

11841184
if not self._is_running_guest(self.stats.pid_filter):
11851185
if self._gname:
1186-
try: # ...to identify the guest by name in case it's back
1186+
try: # ...to identify the guest by name in case it's back
11871187
pids = self.get_pid_from_gname(self._gname)
11881188
if len(pids) == 1:
11891189
self._refresh_header(pids[0])
@@ -1336,8 +1336,8 @@ class Tui(object):
13361336
msg = ''
13371337
while True:
13381338
self.screen.erase()
1339-
self.screen.addstr(0, 0, 'Set update interval (defaults to %.1fs).' %
1340-
DELAY_DEFAULT, curses.A_BOLD)
1339+
self.screen.addstr(0, 0, 'Set update interval (defaults to %.1fs).'
1340+
% DELAY_DEFAULT, curses.A_BOLD)
13411341
self.screen.addstr(4, 0, msg)
13421342
self.screen.addstr(2, 0, 'Change delay from %.1fs to ' %
13431343
self._delay_regular)
@@ -1545,7 +1545,7 @@ Interactive Commands:
15451545
p filter by PID
15461546
q quit
15471547
r reset stats
1548-
s set update interval
1548+
s set update interval (value range: 0.1-25.5 secs)
15491549
x toggle reporting of stats for individual child trace events
15501550
Press any other key to refresh statistics immediately.
15511551
""" % (PATH_DEBUGFS_KVM, PATH_DEBUGFS_TRACING)
@@ -1711,5 +1711,6 @@ def main():
17111711
else:
17121712
batch(stats)
17131713

1714+
17141715
if __name__ == "__main__":
17151716
main()

tools/kvm/kvm_stat/kvm_stat.txt

+20-20
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ INTERACTIVE COMMANDS
4949

5050
*r*:: reset stats
5151

52-
*s*:: set update interval
52+
*s*:: set delay between refreshs
5353

5454
*x*:: toggle reporting of stats for child trace events
5555
:: *Note*: The stats for the parents summarize the respective child trace
@@ -64,37 +64,37 @@ OPTIONS
6464
--batch::
6565
run in batch mode for one second
6666

67-
-l::
68-
--log::
69-
run in logging mode (like vmstat)
70-
71-
-t::
72-
--tracepoints::
73-
retrieve statistics from tracepoints
74-
7567
-d::
7668
--debugfs::
7769
retrieve statistics from debugfs
7870

71+
-f<fields>::
72+
--fields=<fields>::
73+
fields to display (regex), "-f help" for a list of available events
74+
75+
-g<guest>::
76+
--guest=<guest_name>::
77+
limit statistics to one virtual machine (guest name)
78+
79+
-h::
80+
--help::
81+
show help message
82+
7983
-i::
8084
--debugfs-include-past::
8185
include all available data on past events for debugfs
8286

87+
-l::
88+
--log::
89+
run in logging mode (like vmstat)
90+
8391
-p<pid>::
8492
--pid=<pid>::
8593
limit statistics to one virtual machine (pid)
8694

87-
-g<guest>::
88-
--guest=<guest_name>::
89-
limit statistics to one virtual machine (guest name)
90-
91-
-f<fields>::
92-
--fields=<fields>::
93-
fields to display (regex), "-f help" for a list of available events
94-
95-
-h::
96-
--help::
97-
show help message
95+
-t::
96+
--tracepoints::
97+
retrieve statistics from tracepoints
9898

9999
SEE ALSO
100100
--------

0 commit comments

Comments
 (0)