summaryrefslogtreecommitdiffstats
path: root/include/qom
diff options
context:
space:
mode:
authorMarkus Armbruster2019-04-17 21:18:00 +0200
committerMarkus Armbruster2019-04-18 22:18:59 +0200
commit11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98 (patch)
tree40fc2a77e515f2cb6f55bdf50305b1befeee6ad6 /include/qom
parenttarget/i386: Simplify how x86_cpu_dump_local_apic_state() prints (diff)
downloadqemu-11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98.tar.gz
qemu-11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98.tar.xz
qemu-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 'include/qom')
-rw-r--r--include/qom/cpu.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 1d6099e5d4..31bafee2b1 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -184,8 +184,7 @@ typedef struct CPUClass {
void (*dump_state)(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
int flags);
GuestPanicInformation* (*get_crash_info)(CPUState *cpu);
- void (*dump_statistics)(CPUState *cpu, FILE *f,
- fprintf_function cpu_fprintf, int flags);
+ void (*dump_statistics)(CPUState *cpu, int flags);
int64_t (*get_arch_id)(CPUState *cpu);
bool (*get_paging_enabled)(const CPUState *cpu);
void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list,
@@ -576,14 +575,12 @@ void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
/**
* cpu_dump_statistics:
* @cpu: The CPU whose state is to be dumped.
- * @f: File to dump to.
- * @cpu_fprintf: Function to dump with.
* @flags: Flags what to dump.
*
- * Dumps CPU statistics.
+ * Dump CPU statistics to the current monitor if we have one, else to
+ * stdout.
*/
-void cpu_dump_statistics(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
- int flags);
+void cpu_dump_statistics(CPUState *cpu, int flags);
#ifndef CONFIG_USER_ONLY
/**