summaryrefslogtreecommitdiffstats
path: root/tools/kvm
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.vnet.ibm.com>2017-03-10 13:40:10 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-03-29 12:01:29 +0200
commit0152c20f0400498774ae56067f8076cef312abc7 (patch)
tree30ae00548c841690fc6d94bcf61d2d810a043a88 /tools/kvm
parentbe03ea3b77387db36617d71d60ee182a866fb9cd (diff)
downloadblackbird-obmc-linux-0152c20f0400498774ae56067f8076cef312abc7.tar.gz
blackbird-obmc-linux-0152c20f0400498774ae56067f8076cef312abc7.zip
tools/kvm_stat: print error messages on faulty pid filter input
Print helpful messages in case users enter invalid input or invalid pids in the interactive pid filter dialogue. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'tools/kvm')
-rwxr-xr-xtools/kvm/kvm_stat/kvm_stat4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index 9e9eb983f6fe..ced0cb908ddb 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -976,6 +976,7 @@ class Tui(object):
Asks for a pid until a valid pid or 0 has been entered.
"""
+ msg = ''
while True:
self.screen.erase()
self.screen.addstr(0, 0,
@@ -984,6 +985,7 @@ class Tui(object):
self.screen.addstr(1, 0,
'This might limit the shown data to the trace '
'statistics.')
+ self.screen.addstr(5, 0, msg)
curses.echo()
self.screen.addstr(3, 0, "Pid [0 or pid]: ")
@@ -995,6 +997,7 @@ class Tui(object):
pid = int(pid)
if pid != 0 and not os.path.isdir(os.path.join('/proc/',
str(pid))):
+ msg = '"' + str(pid) + '": Not a running process'
continue
else:
pid = 0
@@ -1003,6 +1006,7 @@ class Tui(object):
break
except ValueError:
+ msg = '"' + str(pid) + '": Not a valid pid'
continue
def show_stats(self):
OpenPOWER on IntegriCloud