Skip to content

Commit

Permalink
tools/kvm_stat: rework command line sequence and message texts
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Stefan Raspl authored and bonzini committed Mar 23, 2020
1 parent bfcaa84 commit eecda7a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
9 changes: 5 additions & 4 deletions tools/kvm/kvm_stat/kvm_stat
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ class Tui(object):

if not self._is_running_guest(self.stats.pid_filter):
if self._gname:
try: # ...to identify the guest by name in case it's back
try: # ...to identify the guest by name in case it's back
pids = self.get_pid_from_gname(self._gname)
if len(pids) == 1:
self._refresh_header(pids[0])
Expand Down Expand Up @@ -1336,8 +1336,8 @@ class Tui(object):
msg = ''
while True:
self.screen.erase()
self.screen.addstr(0, 0, 'Set update interval (defaults to %.1fs).' %
DELAY_DEFAULT, curses.A_BOLD)
self.screen.addstr(0, 0, 'Set update interval (defaults to %.1fs).'
% DELAY_DEFAULT, curses.A_BOLD)
self.screen.addstr(4, 0, msg)
self.screen.addstr(2, 0, 'Change delay from %.1fs to ' %
self._delay_regular)
Expand Down Expand Up @@ -1545,7 +1545,7 @@ Interactive Commands:
p filter by PID
q quit
r reset stats
s set update interval
s set update interval (value range: 0.1-25.5 secs)
x toggle reporting of stats for individual child trace events
Press any other key to refresh statistics immediately.
""" % (PATH_DEBUGFS_KVM, PATH_DEBUGFS_TRACING)
Expand Down Expand Up @@ -1711,5 +1711,6 @@ def main():
else:
batch(stats)


if __name__ == "__main__":
main()
40 changes: 20 additions & 20 deletions tools/kvm/kvm_stat/kvm_stat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ INTERACTIVE COMMANDS

*r*:: reset stats

*s*:: set update interval
*s*:: set delay between refreshs

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

-l::
--log::
run in logging mode (like vmstat)

-t::
--tracepoints::
retrieve statistics from tracepoints

-d::
--debugfs::
retrieve statistics from debugfs

-f<fields>::
--fields=<fields>::
fields to display (regex), "-f help" for a list of available events

-g<guest>::
--guest=<guest_name>::
limit statistics to one virtual machine (guest name)

-h::
--help::
show help message

-i::
--debugfs-include-past::
include all available data on past events for debugfs

-l::
--log::
run in logging mode (like vmstat)

-p<pid>::
--pid=<pid>::
limit statistics to one virtual machine (pid)

-g<guest>::
--guest=<guest_name>::
limit statistics to one virtual machine (guest name)

-f<fields>::
--fields=<fields>::
fields to display (regex), "-f help" for a list of available events

-h::
--help::
show help message
-t::
--tracepoints::
retrieve statistics from tracepoints

SEE ALSO
--------
Expand Down

0 comments on commit eecda7a

Please sign in to comment.