"Erlon Cruz" <erlon.c...@fit-tecnologia.org.br> writes: > QEMU monitor command 'info registers' only displays information for the first > CPU. This fix that by show registers information for each CPU in the system
This is incorrect. It displays information for the *current* CPU. Monitor command "cpu" selects the current CPU. I doubt we want to change this command. But I'm reviewing it regardless of my doubts. > Signed-off-by: erlon.c...@fit-tecnologia.org.br > --- > monitor.c | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > > diff --git a/monitor.c b/monitor.c > index c0e32d6..70e9227 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -898,8 +898,14 @@ int monitor_get_cpu_index(void) > static void do_info_registers(Monitor *mon) > { > CPUArchState *env; > - env = mon_get_cpu(); > - cpu_dump_state(env, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); > + > + for (env = first_cpu; env != NULL; env = env->next_cpu) { > + monitor_fprintf((FILE *)mon, "========================= " > + "Registers on CPU %d =========================\n", > + env->cpu_index); > + cpu_dump_state(env, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); > + monitor_fprintf((FILE *)mon, "\n"); > + } > } > You lost the cpu_synchronize_state() in mon_get_cpu(). Why is that okay? > static void do_info_jit(Monitor *mon) > @@ -930,8 +936,13 @@ static void do_info_cpu_stats(Monitor *mon) > { > CPUArchState *env; > > - env = mon_get_cpu(); > - cpu_dump_statistics(env, (FILE *)mon, &monitor_fprintf, 0); > + for (env = first_cpu; env != NULL; env = env->next_cpu) { > + monitor_fprintf((FILE *)mon, "========================= " > + "Statistics for CPU %d =========================\n", > + env->cpu_index); > + cpu_dump_statistics(env, (FILE *)mon, &monitor_fprintf, 0); > + monitor_fprintf((FILE *)mon, "\n"); > + } > } > #endif Same here. Furthermore, you neglected to update the command's documentation in hmp-commands.hx, and the reference to it in qmp-commands.hx.