WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2/2]xl: Add "xl top" command

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/2]xl: Add "xl top" command
From: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
Date: Wed, 12 May 2010 10:53:01 +0800
Delivery-date: Tue, 11 May 2010 19:53:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100415 Thunderbird/3.0.4
Add "xl top" command, a clone of "xm top".

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>

diff -r feb1b75800d6 -r 0efa1c583fb0 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed May 12 18:35:58 2010 +0800
+++ b/tools/libxl/xl_cmdimpl.c  Wed May 12 18:47:12 2010 +0800
@@ -3098,3 +3098,23 @@
 
     exit(0);
 }
+
+int main_top(int argc, char **argv)
+{
+    int opt;
+
+    while ((opt = getopt(argc, argv, "h")) != -1) {
+        switch (opt) {
+        case 'h':
+            help("top");
+            exit(0);
+        default:
+            fprintf(stderr, "option `%c' not supported.\n", opt);
+            break;
+        }
+    }
+
+    system("xentop");
+
+    exit(0);
+}
diff -r feb1b75800d6 -r 0efa1c583fb0 tools/libxl/xl_cmdimpl.h
--- a/tools/libxl/xl_cmdimpl.h  Wed May 12 18:35:58 2010 +0800
+++ b/tools/libxl/xl_cmdimpl.h  Wed May 12 18:47:12 2010 +0800
@@ -40,5 +40,6 @@
 int main_rename(int argc, char **argv);
 int main_trigger(int argc, char **argv);
 int main_sysrq(int argc, char **argv);
+int main_top(int argc, char **argv);
 
 void help(char *command);
diff -r feb1b75800d6 -r 0efa1c583fb0 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c Wed May 12 18:35:58 2010 +0800
+++ b/tools/libxl/xl_cmdtable.c Wed May 12 18:47:12 2010 +0800
@@ -177,6 +177,11 @@
       "Send a sysrq to a domain",
       "<Domain> <letter>",
     },
+    { "top",
+      &main_top,
+      "Monitor a host and the domains in real time",
+      "",
+    },
 };
 
 int cmdtable_len = sizeof(cmd_table)/sizeof(struct cmd_spec);

-- 
Regards
Yang Hongyang

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

<Prev in Thread] Current Thread [Next in Thread>