summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-04-17 21:18:00 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-04-18 22:18:59 +0200
commit11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98 (patch)
tree40fc2a77e515f2cb6f55bdf50305b1befeee6ad6 /target
parentd3fd9e4b79f77afea17213a7b32ba9eda7fc59c1 (diff)
downloadqemu-11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98.zip
qom/cpu: Simplify how CPUClass::dump_statistics() prints
CPUClass method dump_statistics() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_cpustats() (via cpu_dump_statistics()) passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417191805.28198-13-armbru@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/ppc/cpu.h3
-rw-r--r--target/ppc/translate.c9
2 files changed, 5 insertions, 7 deletions
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 8572241364..27a36b9605 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1270,8 +1270,7 @@ void ppc_cpu_do_interrupt(CPUState *cpu);
bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
void ppc_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
int flags);
-void ppc_cpu_dump_statistics(CPUState *cpu, FILE *f,
- fprintf_function cpu_fprintf, int flags);
+void ppc_cpu_dump_statistics(CPUState *cpu, int flags);
hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
int ppc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
int ppc_cpu_gdb_read_register_apple(CPUState *cpu, uint8_t *buf, int reg);
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index badc1ae1a3..f99f27a134 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7593,8 +7593,7 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
#undef RFPL
}
-void ppc_cpu_dump_statistics(CPUState *cs, FILE*f,
- fprintf_function cpu_fprintf, int flags)
+void ppc_cpu_dump_statistics(CPUState *cs, int flags)
{
#if defined(DO_PPC_STATISTICS)
PowerPCCPU *cpu = POWERPC_CPU(cs);
@@ -7614,7 +7613,7 @@ void ppc_cpu_dump_statistics(CPUState *cs, FILE*f,
handler = t3[op3];
if (handler->count == 0)
continue;
- cpu_fprintf(f, "%02x %02x %02x (%02x %04d) %16s: "
+ qemu_printf("%02x %02x %02x (%02x %04d) %16s: "
"%016" PRIx64 " %" PRId64 "\n",
op1, op2, op3, op1, (op3 << 5) | op2,
handler->oname,
@@ -7623,7 +7622,7 @@ void ppc_cpu_dump_statistics(CPUState *cs, FILE*f,
} else {
if (handler->count == 0)
continue;
- cpu_fprintf(f, "%02x %02x (%02x %04d) %16s: "
+ qemu_printf("%02x %02x (%02x %04d) %16s: "
"%016" PRIx64 " %" PRId64 "\n",
op1, op2, op1, op2, handler->oname,
handler->count, handler->count);
@@ -7632,7 +7631,7 @@ void ppc_cpu_dump_statistics(CPUState *cs, FILE*f,
} else {
if (handler->count == 0)
continue;
- cpu_fprintf(f, "%02x (%02x ) %16s: %016" PRIx64
+ qemu_printf("%02x (%02x ) %16s: %016" PRIx64
" %" PRId64 "\n",
op1, op1, handler->oname,
handler->count, handler->count);