]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/tcg: Implement AccelClass::get_stats() handler
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 17 Jun 2025 12:45:29 +0000 (14:45 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 15 Jul 2025 17:34:33 +0000 (19:34 +0200)
Factor tcg_get_stats() out of tcg_dump_stats(),
passing the current accelerator argument to match
the AccelClass::get_stats() prototype.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250715140048.84942-7-philmd@linaro.org>

accel/tcg/internal-common.h
accel/tcg/tcg-all.c
accel/tcg/tcg-stats.c

index 1dbc45dd955d47a2f5c0fcfbda1c08d444bb768e..6adfeefe1318ec8e56795f7e711d50b82f60b58c 100644 (file)
@@ -139,4 +139,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
 void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
 void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr);
 
+void tcg_get_stats(AccelState *accel, GString *buf);
+
 #endif
index eaeb465dfd588cbff8e458110aaeaefbf2195d39..5125e1a4e27d9e312f3e4da051983a27e902a69b 100644 (file)
@@ -243,6 +243,7 @@ static void tcg_accel_class_init(ObjectClass *oc, const void *data)
     ac->init_machine = tcg_init_machine;
     ac->cpu_common_realize = tcg_exec_realizefn;
     ac->cpu_common_unrealize = tcg_exec_unrealizefn;
+    ac->get_stats = tcg_get_stats;
     ac->allowed = &tcg_allowed;
     ac->gdbstub_supported_sstep_flags = tcg_gdbstub_supported_sstep_flags;
 
index e1a1c4cf4ac9b47818688f16ab987e55c6eab6a7..ced5dec0c4fc3fdcabcffe8790b33f4e3ff0f712 100644 (file)
@@ -206,9 +206,14 @@ static void dump_exec_info(GString *buf)
     tcg_dump_flush_info(buf);
 }
 
-void tcg_dump_stats(GString *buf)
+void tcg_get_stats(AccelState *accel, GString *buf)
 {
-    dump_accel_info(current_accel(), buf);
+    dump_accel_info(accel, buf);
     dump_exec_info(buf);
     dump_drift_info(buf);
 }
+
+void tcg_dump_stats(GString *buf)
+{
+    tcg_get_stats(current_accel(), buf);
+}