Running 'qemu-user -D stats.log' will dump TCG statistics to 'stats.log' before exiting.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> --- linux-user/exit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/exit.c b/linux-user/exit.c index 1ff8fe4f072..17d2ad0517b 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -21,7 +21,9 @@ #include "gdbstub/syscalls.h" #include "qemu.h" #include "user-internals.h" +#include "qemu/log.h" #include "qemu/plugin.h" +#include "tcg/tcg.h" #ifdef CONFIG_GCOV extern void __gcov_dump(void); @@ -29,10 +31,14 @@ extern void __gcov_dump(void); void preexit_cleanup(CPUArchState *env, int code) { + g_autoptr(GString) buf = g_string_new(""); + #ifdef CONFIG_GCOV __gcov_dump(); #endif gdb_exit(code); qemu_plugin_user_exit(); perf_exit(); + tcg_dump_stats(buf); + qemu_log("TCG stats: %s", buf->str); } -- 2.49.0