diff options
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -145,6 +145,45 @@ void hmp_info_migrate(Monitor *mon) qapi_free_MigrationInfo(info); } +void hmp_info_cpus(Monitor *mon) +{ + CpuInfoList *cpu_list, *cpu; + + cpu_list = qmp_query_cpus(NULL); + + for (cpu = cpu_list; cpu; cpu = cpu->next) { + int active = ' '; + + if (cpu->value->CPU == monitor_get_cpu_index()) { + active = '*'; + } + + monitor_printf(mon, "%c CPU #%" PRId64 ": ", active, cpu->value->CPU); + + if (cpu->value->has_pc) { + monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc); + } + if (cpu->value->has_nip) { + monitor_printf(mon, "nip=0x%016" PRIx64, cpu->value->nip); + } + if (cpu->value->has_npc) { + monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc); + monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc); + } + if (cpu->value->has_PC) { + monitor_printf(mon, "PC=0x%016" PRIx64, cpu->value->PC); + } + + if (cpu->value->halted) { + monitor_printf(mon, " (halted)"); + } + + monitor_printf(mon, " thread_id=%" PRId64 "\n", cpu->value->thread_id); + } + + qapi_free_CpuInfoList(cpu_list); +} + void hmp_quit(Monitor *mon, const QDict *qdict) { monitor_suspend(mon); |