aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-06-19 18:05:43 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-15 19:28:36 +0200
commitd6c73ac306a8fca6d98f91e447904c5149d56ed8 (patch)
treeff522e820549ee66d4935be49a821c9b8a65c538
parent6ca2eba6d3decff61a725c379876e18869521a5d (diff)
downloadqemu-d6c73ac306a8fca6d98f91e447904c5149d56ed8.zip
qemu-d6c73ac306a8fca6d98f91e447904c5149d56ed8.tar.gz
qemu-d6c73ac306a8fca6d98f91e447904c5149d56ed8.tar.bz2
hw/core/machine: Display CPU model name in 'info cpus' command
Display the CPU model in 'info cpus'. Example before: $ qemu-system-aarch64 -M xlnx-versal-virt -S -monitor stdio QEMU 10.0.0 monitor - type 'help' for more information (qemu) info cpus * CPU #0: thread_id=42924 CPU #1: thread_id=42924 CPU #2: thread_id=42924 CPU #3: thread_id=42924 (qemu) q and after: $ qemu-system-aarch64 -M xlnx-versal-virt -S -monitor stdio QEMU 10.0.50 monitor - type 'help' for more information (qemu) info cpus * CPU #0: thread_id=42916 model=cortex-a72 CPU #1: thread_id=42916 model=cortex-a72 CPU #2: thread_id=42916 model=cortex-r5f CPU #3: thread_id=42916 model=cortex-r5f (qemu) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Message-Id: <20250715090624.52377-3-philmd@linaro.org>
-rw-r--r--hw/core/machine-hmp-cmds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 5ca0da7..3a612e2 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -33,6 +33,7 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
cpu_list = qmp_query_cpus_fast(NULL);
for (cpu = cpu_list; cpu; cpu = cpu->next) {
+ g_autofree char *cpu_model = cpu_model_from_type(cpu->value->qom_type);
int active = ' ';
if (cpu->value->cpu_index == monitor_get_cpu_index(mon)) {
@@ -41,7 +42,8 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "%c CPU #%" PRId64 ":", active,
cpu->value->cpu_index);
- monitor_printf(mon, " thread_id=%" PRId64 "\n", cpu->value->thread_id);
+ monitor_printf(mon, " thread_id=%" PRId64 " model=%s\n",
+ cpu->value->thread_id, cpu_model);
}
qapi_free_CpuInfoFastList(cpu_list);