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-changelog

[Xen-changelog] [xen-unstable] support topolgy info in xl info

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] support topolgy info in xl info
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Dec 2010 15:46:21 -0800
Delivery-date: Fri, 24 Dec 2010 15:50:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1291890200 -3600
# Node ID 8ecbcb19911fc509f75a6f4dfa3d496bf6977c61
# Parent  f713cff1a5870b44927db041745b54d5424014c2
support topolgy info in xl info

Adds option -n/--numa to xl info command to print topology information.
No numa information up to now, as I've no machine which will give this info
via xm info (could be a bug in xm, however).

Signed-off-by: juergen.gross@xxxxxxxxxxxxxx
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |   47 ++++++++++++++++++++++++++++++++++++++++++----
 tools/libxl/xl_cmdtable.c |    2 -
 2 files changed, 44 insertions(+), 5 deletions(-)

diff -r f713cff1a587 -r 8ecbcb19911f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Dec 09 11:21:30 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Thu Dec 09 11:23:20 2010 +0100
@@ -3935,12 +3935,41 @@ static void output_physinfo(void)
     return;
 }
 
-static void info(void)
+static void output_topologyinfo(void)
+{
+    libxl_topologyinfo info;
+    int i;
+
+    if (libxl_get_topologyinfo(&ctx, &info)) {
+        fprintf(stderr, "libxl_get_topologyinfo failed.\n");
+        return;
+    }
+
+    printf("cpu_topology           :\n");
+    printf("cpu:    core    socket     node\n");
+
+    for (i = 0; i < info.coremap.entries; i++) {
+        if (info.coremap.array[i] != LIBXL_CPUARRAY_INVALID_ENTRY)
+            printf("%3d:    %4d     %4d     %4d\n", i, info.coremap.array[i],
+                info.socketmap.array[i], info.nodemap.array[i]);
+    }
+
+    printf("numa_info              : none\n");
+
+    libxl_topologyinfo_destroy(&info);
+
+    return;
+}
+
+static void info(int numa)
 {
     output_nodeinfo();
 
     output_physinfo();
 
+    if (numa)
+        output_topologyinfo();
+
     output_xeninfo();
 
     printf("xend_config_format     : 4\n");
@@ -3951,19 +3980,29 @@ int main_info(int argc, char **argv)
 int main_info(int argc, char **argv)
 {
     int opt;
-
-    while ((opt = getopt(argc, argv, "h")) != -1) {
+    int option_index = 0;
+    static struct option long_options[] = {
+        {"help", 0, 0, 'h'},
+        {"numa", 0, 0, 'n'},
+        {0, 0, 0, 0}
+    };
+    int numa = 0;
+
+    while ((opt = getopt_long(argc, argv, "hn", long_options, &option_index)) 
!= -1) {
         switch (opt) {
         case 'h':
             help("info");
             return 0;
+        case 'n':
+            numa = 1;
+            break;
         default:
             fprintf(stderr, "option `%c' not supported.\n", opt);
             break;
         }
     }
 
-    info();
+    info(numa);
     return 0;
 }
 
diff -r f713cff1a587 -r 8ecbcb19911f tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c Thu Dec 09 11:21:30 2010 +0100
+++ b/tools/libxl/xl_cmdtable.c Thu Dec 09 11:23:20 2010 +0100
@@ -185,7 +185,7 @@ struct cmd_spec cmd_table[] = {
     { "info",
       &main_info,
       "Get information about Xen host",
-      "",
+      "-n, --numa         List host NUMA topology information",
     },
     { "sched-credit",
       &main_sched_credit,

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] support topolgy info in xl info, Xen patchbot-unstable <=