aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/xl_cmdimpl.c
diff options
context:
space:
mode:
authorDario Faggioli <raistlin@linux.it>2012-07-06 13:17:42 +0100
committerDario Faggioli <raistlin@linux.it>2012-07-06 13:17:42 +0100
commitb13da96bb67a6392c94556991d222fcdd8af9257 (patch)
tree0e968bdcb654ae5b5dd62e8795a9f7b0a975cb76 /tools/libxl/xl_cmdimpl.c
parent97467ae4a049d30a8bf1d00cec67ff6c41e18168 (diff)
downloadxen-b13da96bb67a6392c94556991d222fcdd8af9257.tar.gz
xen-b13da96bb67a6392c94556991d222fcdd8af9257.tar.bz2
xen-b13da96bb67a6392c94556991d222fcdd8af9257.zip
xl: add more NUMA information to `xl info -n'
So that the user knows how much memory there is on each node and how far they are from each others. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/xl_cmdimpl.c')
-rw-r--r--tools/libxl/xl_cmdimpl.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 6fef819a42..f98dab7af6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4254,6 +4254,36 @@ static void output_physinfo(void)
return;
}
+static void output_numainfo(void)
+{
+ libxl_numainfo *info;
+ int i, j, nr;
+
+ info = libxl_get_numainfo(ctx, &nr);
+ if (info == NULL) {
+ fprintf(stderr, "libxl_get_numainfo failed.\n");
+ return;
+ }
+
+ printf("numa_info :\n");
+ printf("node: memsize memfree distances\n");
+
+ for (i = 0; i < nr; i++) {
+ if (info[i].size != LIBXL_NUMAINFO_INVALID_ENTRY) {
+ printf("%4d: %6"PRIu64" %6"PRIu64" %d", i,
+ info[i].size >> 20, info[i].free >> 20,
+ info[i].dists[0]);
+ for (j = 1; j < info[i].num_dists; j++)
+ printf(",%d", info[i].dists[j]);
+ printf("\n");
+ }
+ }
+
+ libxl_numainfo_list_free(info, nr);
+
+ return;
+}
+
static void output_topologyinfo(void)
{
libxl_cputopology *info;
@@ -4276,8 +4306,6 @@ static void output_topologyinfo(void)
libxl_cputopology_list_free(info, nr);
- printf("numa_info : none\n");
-
return;
}
@@ -4287,8 +4315,10 @@ static void info(int numa)
output_physinfo();
- if (numa)
+ if (numa) {
output_topologyinfo();
+ output_numainfo();
+ }
output_xeninfo();