diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-06-17 11:48:44 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-07-04 14:43:45 +0200 |
commit | 8becf103741bd1b50b827bc3cd60872e9f36e981 (patch) | |
tree | b5c90666f5b7ee0f1951371aa77b38dfa5ac2b76 | |
parent | 93d7064e594f442235d7d9442005f4404a7a5004 (diff) | |
download | qemu-8becf103741bd1b50b827bc3cd60872e9f36e981.zip qemu-8becf103741bd1b50b827bc3cd60872e9f36e981.tar.gz qemu-8becf103741bd1b50b827bc3cd60872e9f36e981.tar.bz2 |
accel/tcg: Factor tcg_dump_flush_info() out
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250703173248.44995-10-philmd@linaro.org>
-rw-r--r-- | accel/tcg/monitor.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 344ec50..6d9cc11 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -141,11 +141,26 @@ static void tlb_flush_counts(size_t *pfull, size_t *ppart, size_t *pelide) *pelide = elide; } +static void tcg_dump_flush_info(GString *buf) +{ + size_t flush_full, flush_part, flush_elide; + + g_string_append_printf(buf, "TB flush count %u\n", + qatomic_read(&tb_ctx.tb_flush_count)); + g_string_append_printf(buf, "TB invalidate count %u\n", + qatomic_read(&tb_ctx.tb_phys_invalidate_count)); + + tlb_flush_counts(&flush_full, &flush_part, &flush_elide); + g_string_append_printf(buf, "TLB full flushes %zu\n", flush_full); + g_string_append_printf(buf, "TLB partial flushes %zu\n", flush_part); + g_string_append_printf(buf, "TLB elided flushes %zu\n", flush_elide); +} + static void dump_exec_info(GString *buf) { struct tb_tree_stats tst = {}; struct qht_stats hst; - size_t nb_tbs, flush_full, flush_part, flush_elide; + size_t nb_tbs; tcg_tb_foreach(tb_tree_stats_iter, &tst); nb_tbs = tst.nb_tbs; @@ -182,15 +197,7 @@ static void dump_exec_info(GString *buf) qht_statistics_destroy(&hst); g_string_append_printf(buf, "\nStatistics:\n"); - g_string_append_printf(buf, "TB flush count %u\n", - qatomic_read(&tb_ctx.tb_flush_count)); - g_string_append_printf(buf, "TB invalidate count %u\n", - qatomic_read(&tb_ctx.tb_phys_invalidate_count)); - - tlb_flush_counts(&flush_full, &flush_part, &flush_elide); - g_string_append_printf(buf, "TLB full flushes %zu\n", flush_full); - g_string_append_printf(buf, "TLB partial flushes %zu\n", flush_part); - g_string_append_printf(buf, "TLB elided flushes %zu\n", flush_elide); + tcg_dump_flush_info(buf); } HumanReadableText *qmp_x_query_jit(Error **errp) |