Skip to contentSkip to conversation

[7211] add info numa command to monitor (Andre Przywara)

Qemu-devel Applied Anthony Liguori 3 participants 3 messages Apr 21, 2009 – Apr 22, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 7211

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7211
Author:   aliguori
Date:     2009-04-21 22:30:47 +0000 (Tue, 21 Apr 2009)

Log Message:
-----------
add info numa command to monitor (Andre Przywara)

adds an "info numa" command to the monitor to output the current topology. Since NUMA is advertised via static ACPI tables, no changes are possible during runtime.

Modified Paths:
--------------
trunk/monitor.c

Modified: trunk/monitor.c
===================================================================

monitor.c +21 -0
@@ -1409,6 +1409,25 @@
 #endif
 }
 
+static void do_info_numa(Monitor *mon)
+{
+    int i, j;
+    CPUState *env;
+
+    monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
+    for (i = 0; i < nb_numa_nodes; i++) {
+        monitor_printf(mon, "node %d cpus:", i);
+        for (env = first_cpu; env != NULL; env = env->next_cpu) {
+            if (env->numa_node == i) {
+                monitor_printf(mon, " %d", env->cpu_index);
+            }
+        }
+        monitor_printf(mon, "\n");
+        monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
+            node_mem[i] >> 20);
+    }
+}
+
 #ifdef CONFIG_PROFILER
 
 int64_t kqemu_time;
@@ -1792,6 +1811,8 @@
       "", "show KQEMU information", },
     { "kvm", "", do_info_kvm,
       "", "show KVM information", },
+    { "numa", "", do_info_numa,
+      "", "show NUMA information", },
     { "usb", "", usb_info,
       "", "show guest USB devices", },
     { "usbhost", "", usb_host_info,
#1 lore raw

PATCH 1/1 monitor: Fix warning in do_info_numa

---

 monitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
monitor.c +1 -1
index 3e945db..b33fea1 100644
@@ -1411,7 +1411,7 @@ static void do_info_kvm(Monitor *mon)
 
 static void do_info_numa(Monitor *mon)
 {
-    int i, j;
+    int i;
     CPUState *env;
 
     monitor_printf(mon, "%d nodes\n", nb_numa_nodes);