diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-06-17 14:45:29 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-07-15 19:34:33 +0200 |
commit | cf4305ed7a24f25cef0bd35609d03ea688fa24fa (patch) | |
tree | f2e7a26410739682cf7b69420ed70eeb4a216a42 | |
parent | 2320453031f87e4245a5625f3714d444e987ea0c (diff) | |
download | qemu-cf4305ed7a24f25cef0bd35609d03ea688fa24fa.zip qemu-cf4305ed7a24f25cef0bd35609d03ea688fa24fa.tar.gz qemu-cf4305ed7a24f25cef0bd35609d03ea688fa24fa.tar.bz2 |
accel/tcg: Implement AccelClass::get_stats() handler
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>
-rw-r--r-- | accel/tcg/internal-common.h | 2 | ||||
-rw-r--r-- | accel/tcg/tcg-all.c | 1 | ||||
-rw-r--r-- | accel/tcg/tcg-stats.c | 9 |
3 files changed, 10 insertions, 2 deletions
diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 1dbc45d..6adfeef 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -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 diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index eaeb465..5125e1a 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -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; diff --git a/accel/tcg/tcg-stats.c b/accel/tcg/tcg-stats.c index e1a1c4c..ced5dec 100644 --- a/accel/tcg/tcg-stats.c +++ b/accel/tcg/tcg-stats.c @@ -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); +} |