From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: fei2.wu@intel.com
Subject: Re: [PATCH v17 16/16] accel/tcg: Dump hot TBs at the end of the execution
Date: Tue, 10 Oct 2023 14:36:52 +0200 [thread overview]
Message-ID: <b8911ed0-9eae-a0d0-1b32-61876d4ee55a@linaro.org> (raw)
In-Reply-To: <20231003183058.1639121-17-richard.henderson@linaro.org>
On 3/10/23 20:30, Richard Henderson wrote:
> From: Fei Wu <fei2.wu@intel.com>
>
> Dump the hottest TBs if -d tb_stats:{all,jit,exec}[:dump_num_at_exit]
>
> Signed-off-by: Fei Wu <fei2.wu@intel.com>
> Signed-off-by: Richard Henderson <richard.henderson@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();
+ }
/*
* We must cancel all block jobs while the block layer is drained,
---
next prev parent reply other threads:[~2023-10-10 12:37 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 18:30 [PATCH v17 00/16] TCG code quality tracking Richard Henderson
2023-10-03 18:30 ` [PATCH v17 01/16] accel/tcg: Move HMP info jit and info opcount code Richard Henderson
2023-10-10 12:09 ` Philippe Mathieu-Daudé
2023-10-15 12:58 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 02/16] tcg: Record orig_nb_ops TCGContext Richard Henderson
2023-10-15 12:57 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 03/16] tcg: Record nb_deleted_ops in TCGContext Richard Henderson
2023-10-15 12:58 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 04/16] tcg: Record nb_spills " Richard Henderson
2023-10-15 12:59 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 05/16] accel/tcg: Add TBStatistics structure Richard Henderson
2023-10-16 14:38 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 06/16] accel/tcg: Collect TB execution statistics Richard Henderson
2023-10-03 18:30 ` [PATCH v17 07/16] accel/tcg: Collect TB jit statistics Richard Henderson
2023-10-10 12:13 ` Philippe Mathieu-Daudé
2023-10-03 18:30 ` [PATCH v17 08/16] accel/tcg: Add tb_stats hmp command Richard Henderson
2023-10-03 18:30 ` [PATCH v17 09/16] util/log: Add Error argument to qemu_str_to_log_mask Richard Henderson
2023-10-10 12:55 ` Markus Armbruster
2023-10-15 18:55 ` Richard Henderson
2023-10-03 18:30 ` [PATCH v17 10/16] util/log: Add -d tb_stats Richard Henderson
2023-10-10 12:34 ` Philippe Mathieu-Daudé
2023-10-15 19:53 ` Richard Henderson
2023-10-03 18:30 ` [PATCH v17 11/16] accel/tcg: Add tb_stats_collect and tb_stats_dump Richard Henderson
2023-10-16 14:48 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 12/16] softmmu: Export qemu_ram_ptr_length Richard Henderson
2023-10-10 12:31 ` Philippe Mathieu-Daudé
2023-10-03 18:30 ` [PATCH v17 13/16] disas: Allow monitor_disas to read from ram_addr_t Richard Henderson
2023-10-10 12:46 ` Philippe Mathieu-Daudé
2023-10-15 19:21 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 14/16] monitor: Change MonitorDec.get_value return type to int64_t Richard Henderson
2023-10-16 14:59 ` Alex Bennée
2023-10-16 15:43 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 15/16] accel/tcg: Add info [tb-list|tb] commands to HMP Richard Henderson
2023-10-16 15:02 ` Alex Bennée
2023-10-03 18:30 ` [PATCH v17 16/16] accel/tcg: Dump hot TBs at the end of the execution Richard Henderson
2023-10-10 12:36 ` Philippe Mathieu-Daudé [this message]
2023-10-10 13:23 ` Alex Bennée
2024-11-14 9:28 ` [PATCH v17 00/16] TCG code quality tracking Nikita Shubin
2025-01-21 10:22 ` Chinmay Rath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8911ed0-9eae-a0d0-1b32-61876d4ee55a@linaro.org \
--to=philmd@linaro.org \
--cc=fei2.wu@intel.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).