]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/tcg: Propagate AccelState to dump_accel_info()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 8 Jul 2025 12:09:29 +0000 (14:09 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 15 Jul 2025 17:34:33 +0000 (19:34 +0200)
Declare tcg_dump_stats() in "tcg/tcg.h" so it can be used out of
accel/tcg/, like by {bsd,linux}-user.

Next commit will register the TCG AccelClass::get_stats handler,
which expects a AccelState, so propagate it to dump_accel_info().

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

accel/tcg/internal-common.h
accel/tcg/monitor.c
accel/tcg/tcg-stats.c
include/tcg/tcg.h

index 77a3a0684a5b2d97d9ce0105b2f1dd5e78595fa5..1dbc45dd955d47a2f5c0fcfbda1c08d444bb768e 100644 (file)
@@ -139,6 +139,4 @@ 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_dump_stats(GString *buf);
-
 #endif
index adb9de5a1c62c2ab4e6ff1a3fb85b9e478c37531..be5c1950177c2d83e7959baa5518d69c5a498529 100644 (file)
@@ -12,6 +12,7 @@
 #include "qapi/qapi-commands-machine.h"
 #include "monitor/monitor.h"
 #include "system/tcg.h"
+#include "tcg/tcg.h"
 #include "internal-common.h"
 
 HumanReadableText *qmp_x_query_jit(Error **errp)
index eb6e20ae98558c719efcf4c17cb98cb33ee36eb4..e1a1c4cf4ac9b47818688f16ab987e55c6eab6a7 100644 (file)
@@ -37,9 +37,8 @@ static void dump_drift_info(GString *buf)
     }
 }
 
-static void dump_accel_info(GString *buf)
+static void dump_accel_info(AccelState *accel, GString *buf)
 {
-    AccelState *accel = current_accel();
     bool one_insn_per_tb = object_property_get_bool(OBJECT(accel),
                                                     "one-insn-per-tb",
                                                     &error_fatal);
@@ -209,7 +208,7 @@ static void dump_exec_info(GString *buf)
 
 void tcg_dump_stats(GString *buf)
 {
-    dump_accel_info(buf);
+    dump_accel_info(current_accel(), buf);
     dump_exec_info(buf);
     dump_drift_info(buf);
 }
index 0c2a319c11db1ba48b65373c81634bcd15755d93..a6d9aa50d473120e16395b315982edc4c27febcb 100644 (file)
@@ -1005,5 +1005,7 @@ static inline const TCGOpcode *tcg_swap_vecop_list(const TCGOpcode *n)
 
 bool tcg_can_emit_vecop_list(const TCGOpcode *, TCGType, unsigned);
 void tcg_dump_ops(TCGContext *s, FILE *f, bool have_prefs);
+/* tcg_dump_stats: Append TCG statistics to @buf */
+void tcg_dump_stats(GString *buf);
 
 #endif /* TCG_H */