Commit 030ea37b4898005fa2bc8ccaf2dd22368602b78f

Authored by aliguori
1 parent 268a362c

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.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7211 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 21 additions and 0 deletions
monitor.c
@@ -1409,6 +1409,25 @@ static void do_info_kvm(Monitor *mon) @@ -1409,6 +1409,25 @@ static void do_info_kvm(Monitor *mon)
1409 #endif 1409 #endif
1410 } 1410 }
1411 1411
  1412 +static void do_info_numa(Monitor *mon)
  1413 +{
  1414 + int i, j;
  1415 + CPUState *env;
  1416 +
  1417 + monitor_printf(mon, "%d nodes\n", nb_numa_nodes);
  1418 + for (i = 0; i < nb_numa_nodes; i++) {
  1419 + monitor_printf(mon, "node %d cpus:", i);
  1420 + for (env = first_cpu; env != NULL; env = env->next_cpu) {
  1421 + if (env->numa_node == i) {
  1422 + monitor_printf(mon, " %d", env->cpu_index);
  1423 + }
  1424 + }
  1425 + monitor_printf(mon, "\n");
  1426 + monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i,
  1427 + node_mem[i] >> 20);
  1428 + }
  1429 +}
  1430 +
1412 #ifdef CONFIG_PROFILER 1431 #ifdef CONFIG_PROFILER
1413 1432
1414 int64_t kqemu_time; 1433 int64_t kqemu_time;
@@ -1792,6 +1811,8 @@ static const mon_cmd_t info_cmds[] = { @@ -1792,6 +1811,8 @@ static const mon_cmd_t info_cmds[] = {
1792 "", "show KQEMU information", }, 1811 "", "show KQEMU information", },
1793 { "kvm", "", do_info_kvm, 1812 { "kvm", "", do_info_kvm,
1794 "", "show KVM information", }, 1813 "", "show KVM information", },
  1814 + { "numa", "", do_info_numa,
  1815 + "", "show NUMA information", },
1795 { "usb", "", usb_info, 1816 { "usb", "", usb_info,
1796 "", "show guest USB devices", }, 1817 "", "show guest USB devices", },
1797 { "usbhost", "", usb_host_info, 1818 { "usbhost", "", usb_host_info,