show register info for all cpus
PATCH 1/1 show register info for all cpus
Currently, we only do a register dump for mon_cpu(). Modify do_info_registers() in order to show what's going on in all of them.
--- qemu/monitor.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)
qemu/monitor.c +11 -7
@@ -292,16 +292,20 @@ static CPUState *mon_get_cpu(void)static void do_info_registers (void ) {CPUState *env; - env =mon_get_cpu (); -if (!env) -return ; + +mon_get_cpu (); + +for (env = first_cpu; env !=NULL ; env = env->next_cpu) { +term_printf ("CPU: %d\n" , env->cpu_index);#ifdef TARGET_I386 -cpu_dump_state (env,NULL , monitor_fprintf, -X86_DUMP_FPU ); +cpu_dump_state (env,NULL , monitor_fprintf, +X86_DUMP_FPU );#else -cpu_dump_state (env,NULL , monitor_fprintf, -0 ); +cpu_dump_state (env,NULL , monitor_fprintf, +0 );#endif + } +term_printf ("\n" ); }static void do_info_cpus (void )
Signature · 1 line
1.5.5.1
Quoted 4 lines · Glauber Costa
Currently, we only do a register dump for
mon_cpu(). Modifydo_info_registers()in order to show what's going on in all of them.
The currently implemented behaviour is to allow the 'cpu' command to determine which CPU the various monitor commands operate with (including info registers). This is pretty consistent throughout the monitor.
Do you disagree with this behaviour or were you just not aware of it? It's unclear from the description in your patch.
Regards,
Anthony Liguori
Quoted 38 lines
Signed-off-by Glauber Costa <[email protected]>--- qemu/monitor.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)qemu/monitor.c +11
-7@@ -292,16 +292,20 @@ static CPUState *mon_get_cpu(void)static void do_info_registers (void ) {CPUState *env; - env =mon_get_cpu (); -if (!env) -return ; + +mon_get_cpu (); + +for (env = first_cpu; env !=NULL ; env = env->next_cpu) { +term_printf ("CPU: %d\n" , env->cpu_index);#ifdef TARGET_I386 -cpu_dump_state (env,NULL , monitor_fprintf, -X86_DUMP_FPU ); +cpu_dump_state (env,NULL , monitor_fprintf, +X86_DUMP_FPU );#else -cpu_dump_state (env,NULL , monitor_fprintf, -0 ); +cpu_dump_state (env,NULL , monitor_fprintf, +0 );#endif + } +term_printf ("\n" ); }static void do_info_cpus (void )
Quoted 7 lines · Anthony Liguori
Quoted 5 lines · Glauber Costa
Currently, we only do a register dump for
mon_cpu(). Modifydo_info_registers()in order to show what's going on in all of them.
Quoted 6 lines
The currently implemented behaviour is to allow the 'cpu' command to determine which CPU the various monitor commands operate with (including info registers). This is pretty consistent throughout the monitor.
Do you disagree with this behaviour or were you just not aware of it? It's unclear from the description in your patch.
More like not aware. Although I did know about it (in the past), I was short termed influenced by "info cpus" output. Maybe we should show just one of them at info cpus, for consistency ?
Quoted 45 lines
Regards,
Anthony Liguori
Quoted 37 lines
Signed-off-by Glauber Costa <[email protected]>--- qemu/monitor.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)qemu/monitor.c +11
-7@@ -292,16 +292,20 @@ static CPUState *mon_get_cpu(void)static void do_info_registers (void ) {CPUState *env; - env =mon_get_cpu (); -if (!env) -return ; + +mon_get_cpu (); + +for (env = first_cpu; env !=NULL ; env = env->next_cpu) { +term_printf ("CPU: %d\n" , env->cpu_index);#ifdef TARGET_I386 -cpu_dump_state (env,NULL , monitor_fprintf, -X86_DUMP_FPU ); +cpu_dump_state (env,NULL , monitor_fprintf, +X86_DUMP_FPU );#else -cpu_dump_state (env,NULL , monitor_fprintf, -0 ); +cpu_dump_state (env,NULL , monitor_fprintf, +0 );#endif + } +term_printf ("\n" ); }static void do_info_cpus (void )
Signature · 5 lines
Glauber Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act."
Quoted 10 lines · Glauber Costa
Quoted 3 lines · Anthony Liguori
Do you disagree with this behaviour or were you just not aware of it? It's unclear from the description in your patch.
More like not aware. Although I did know about it (in the past), I was short termed influenced by "info cpus" output. Maybe we should show just one of them at info cpus, for consistency ?
I would be afraid of breaking management applications that rely on the output. Plus, 'info cpus' implies information about multiple cpus :-)
Regards,
Anthony Liguori