[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [patch] xenmon.py: add next/previous bindings to curses mode


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Diwaker Gupta" <diwaker.lists@xxxxxxxxx>
  • Date: Mon, 6 Mar 2006 13:20:15 -0800
  • Delivery-date: Mon, 06 Mar 2006 21:20:56 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Ak7sgYiaR0TkbUmfQLurlI2p7ZpwcFX4ugfNZtwJrY6WFl23VZ0nlm3b0J+t25lZEWDRG0ACZvaLq1xzuMIF8YihL3jwJKVc1ZZp2+ny4OPgUFUlVMUescJAdW8x91HTizOGJ6gjqdLiWYlxXP5GH9rYKKqo8BQpMMk2PW9baC4=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Cycling around many CPUs in XenMon's curses mode can get cumbersome.
This trivial patch adds bindings to move to the previous CPU. The
next/previous binding seems more natural to me than the earlier cycle
binding, but we can keep them all for now.

# HG changeset patch
# Node ID 146b5c76086c07fad61bea7ccf60f2f4fd66abbd
# Parent  7dd31dbf16e75f0f70e0f9c44b2bb2b5fc6eecf1
Add next/previous key bindings to XenMon curses mode.

Signed-off-by: Diwaker Gupta <dgupta@xxxxxxxxxxx>

diff -r 7dd31dbf16e7 -r 146b5c76086c tools/xenmon/xenmon.py
--- a/tools/xenmon/xenmon.py    Mon Mar  6 13:02:50 2006 -0800
+++ b/tools/xenmon/xenmon.py    Mon Mar  6 13:17:38 2006 -0800
@@ -452,6 +452,12 @@ def show_livestats():
         if c == ord('c'):
             cpu = (cpu + 1) % ncpu

+        # n/p = cycle to the next/previous CPU
+        if c == ord('n'):
+            cpu = (cpu + 1) % ncpu
+        if c == ord('p'):
+            cpu = (cpu - 1) % ncpu
+
         stdscr.erase()

     _c.nocbreak()

--
Web/Blog/Gallery: http://floatingsun.net/blog

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.