Philippe Mathieu-Daudé <phi...@linaro.org> writes:
> On 3/10/23 20:30, Richard Henderson wrote: >> From: Fei Wu <fei2...@intel.com> >> Dump the hottest TBs if -d >> tb_stats:{all,jit,exec}[:dump_num_at_exit] >> Signed-off-by: Fei Wu <fei2...@intel.com> >> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> >> --- >> bsd-user/bsd-proc.h | 2 ++ >> include/tcg/tb-stats.h | 10 +++++++++- >> accel/tcg/monitor.c | 8 +++++--- >> accel/tcg/tb-stats.c | 27 ++++++++++++++++++++++++++- >> linux-user/exit.c | 10 ++++++---- >> softmmu/runstate.c | 2 ++ >> stubs/tb-stats.c | 6 +++++- >> util/log.c | 20 ++++++++++++++++---- >> 8 files changed, 71 insertions(+), 14 deletions(-) > > >> diff --git a/softmmu/runstate.c b/softmmu/runstate.c >> index 1652ed0439..2c6fb9bff1 100644 >> --- a/softmmu/runstate.c >> +++ b/softmmu/runstate.c >> @@ -59,6 +59,7 @@ >> #include "sysemu/runstate-action.h" >> #include "sysemu/sysemu.h" >> #include "sysemu/tpm.h" >> +#include "tcg/tb-stats.h" >> #include "trace.h" >> static NotifierList exit_notifiers = >> @@ -846,6 +847,7 @@ void qemu_cleanup(void) >> /* No more vcpu or device emulation activity beyond this point */ >> vm_shutdown(); >> replay_finish(); >> + tb_stats_dump_atexit(); >> /* >> * We must cancel all block jobs while the block layer is drained, >> diff --git a/stubs/tb-stats.c b/stubs/tb-stats.c >> index ceaa1622ce..f9e4ef5d04 100644 >> --- a/stubs/tb-stats.c >> +++ b/stubs/tb-stats.c >> @@ -11,6 +11,10 @@ >> #include "qemu/osdep.h" >> #include "tcg/tb-stats.h" >> -void tb_stats_init(uint32_t flags) >> +void tb_stats_init(uint32_t flags, uint32_t atexit) >> +{ >> +} >> + >> +void tb_stats_dump_atexit(void) >> { >> } > > The stub isn't needed using: > > -- >8 -- > diff --git a/softmmu/runstate.c b/softmmu/runstate.c > index 2c6fb9bff1..d05e2b8e1c 100644 > --- a/softmmu/runstate.c > +++ b/softmmu/runstate.c > @@ -52,6 +52,7 @@ > #include "qom/object.h" > #include "qom/object_interfaces.h" > #include "sysemu/cpus.h" > +#include "sysemu/tcg.h" > #include "sysemu/qtest.h" > #include "sysemu/replay.h" > #include "sysemu/reset.h" > @@ -847,7 +848,9 @@ void qemu_cleanup(void) > /* No more vcpu or device emulation activity beyond this point */ > vm_shutdown(); > replay_finish(); > - tb_stats_dump_atexit(); > + if (tcg_enabled()) { > + tb_stats_dump_atexit(); > + } Why be different from replay_finish() which is a stub? -- Alex Bennée Virtualisation Tech Lead @ Linaro