* [Qemu-devel] [PATCH v2] hmp: fix info cpus for sparc targets
@ 2012-10-19 21:19 Aurelien Jarno
2012-10-22 15:12 ` Luiz Capitulino
0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2012-10-19 21:19 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Markus Armbruster, Aurelien Jarno, Luiz Capitulino
On sparc targets, info cpus returns this kind of output:
| info cpus
| * CPU #0: pc=0x0000000000424d18pc=0x0000000000424d18npc=0x0000000000424d1c thread_id=19460
pc is printed twice, there is no space between pc, pc and npc.
With this patch, pc is not printed anymore when has_npc is set. In addition
the space is printed before pc/nip/npc/PC instead of after the colon so that
multiple prints are possible. This result on the following kind of input on
sparc targets:
| info cpus
| * CPU #0: pc=0x0000000000424d18 npc=0x0000000000424d1c thread_id=19460
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
hmp.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
Changes v1 -> v2: strategy change, has_npc doesn't imply has_pc anymore.
diff --git a/hmp.c b/hmp.c
index 70bdec2..296adc3 100644
--- a/hmp.c
+++ b/hmp.c
@@ -233,20 +233,19 @@ void hmp_info_cpus(Monitor *mon)
active = '*';
}
- monitor_printf(mon, "%c CPU #%" PRId64 ": ", active, cpu->value->CPU);
+ 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);
+ 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);
+ 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);
+ 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);
+ monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->PC);
}
if (cpu->value->halted) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] hmp: fix info cpus for sparc targets
2012-10-19 21:19 [Qemu-devel] [PATCH v2] hmp: fix info cpus for sparc targets Aurelien Jarno
@ 2012-10-22 15:12 ` Luiz Capitulino
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Capitulino @ 2012-10-22 15:12 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Blue Swirl, qemu-devel, Markus Armbruster
On Fri, 19 Oct 2012 23:19:19 +0200
Aurelien Jarno <aurelien@aurel32.net> wrote:
> On sparc targets, info cpus returns this kind of output:
>
> | info cpus
> | * CPU #0: pc=0x0000000000424d18pc=0x0000000000424d18npc=0x0000000000424d1c thread_id=19460
>
> pc is printed twice, there is no space between pc, pc and npc.
>
> With this patch, pc is not printed anymore when has_npc is set. In addition
> the space is printed before pc/nip/npc/PC instead of after the colon so that
> multiple prints are possible. This result on the following kind of input on
> sparc targets:
>
> | info cpus
> | * CPU #0: pc=0x0000000000424d18 npc=0x0000000000424d1c thread_id=19460
>
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
I've applied this one to the qmp branch. If you want to merge it yourself
feel free to add:
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
> hmp.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> Changes v1 -> v2: strategy change, has_npc doesn't imply has_pc anymore.
>
> diff --git a/hmp.c b/hmp.c
> index 70bdec2..296adc3 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -233,20 +233,19 @@ void hmp_info_cpus(Monitor *mon)
> active = '*';
> }
>
> - monitor_printf(mon, "%c CPU #%" PRId64 ": ", active, cpu->value->CPU);
> + 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);
> + 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);
> + 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);
> + 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);
> + monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->PC);
> }
>
> if (cpu->value->halted) {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-22 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 21:19 [Qemu-devel] [PATCH v2] hmp: fix info cpus for sparc targets Aurelien Jarno
2012-10-22 15:12 ` Luiz Capitulino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).