[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 22/43] translate-all: define and use DEBUG_TB_FLU
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v3 22/43] translate-all: define and use DEBUG_TB_FLUSH_GATE |
Date: |
Wed, 19 Jul 2017 23:09:08 -0400 |
This gets rid of some ifdef checks while ensuring that the debug code
is compiled, which prevents bit rot.
Suggested-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
---
accel/tcg/translate-all.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 645bc70..c1cd258 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -65,6 +65,12 @@
/* make various TB consistency checks */
/* #define DEBUG_TB_CHECK */
+#ifdef DEBUG_TB_FLUSH
+#define DEBUG_TB_FLUSH_GATE 1
+#else
+#define DEBUG_TB_FLUSH_GATE 0
+#endif
+
#if !defined(CONFIG_USER_ONLY)
/* TB consistency checks only implemented for usermode emulation. */
#undef DEBUG_TB_CHECK
@@ -899,13 +905,13 @@ static void do_tb_flush(CPUState *cpu, run_on_cpu_data
tb_flush_count)
goto done;
}
-#if defined(DEBUG_TB_FLUSH)
- printf("qemu: flush code_size=%ld nb_tbs=%d avg_tb_size=%ld\n",
- (unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer),
- tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ?
- ((unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer)) /
- tcg_ctx.tb_ctx.nb_tbs : 0);
-#endif
+ if (DEBUG_TB_FLUSH_GATE) {
+ printf("qemu: flush code_size=%td nb_tbs=%d avg_tb_size=%td\n",
+ tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer,
+ tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ?
+ (tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer) /
+ tcg_ctx.tb_ctx.nb_tbs : 0);
+ }
if ((unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer)
> tcg_ctx.code_gen_buffer_size) {
cpu_abort(cpu, "Internal error: code buffer overflow\n");
--
2.7.4
- [Qemu-devel] [PATCH v3 03/43] exec-all: fix typos in TranslationBlock's documentation, (continued)
- [Qemu-devel] [PATCH v3 03/43] exec-all: fix typos in TranslationBlock's documentation, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 04/43] translate-all: make have_tb_lock static, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 07/43] tcg/mips: constify tcg_target_callee_save_regs, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 15/43] target/i386: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 08/43] tcg: remove addr argument from lookup_tb_ptr, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 06/43] tcg/i386: constify tcg_target_callee_save_regs, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 01/43] cputlb: bring back tlb_flush_count under !TLB_DEBUG, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 16/43] target/m68k: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 19/43] target/sparc: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 22/43] translate-all: define and use DEBUG_TB_FLUSH_GATE,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v3 32/43] tcg: take .helpers out of TCGContext, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 29/43] translate-all: report correct avg host TB size, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 25/43] translate-all: define and use DEBUG_TB_CHECK_GATE, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 24/43] translate-all: define and use DEBUG_TB_INVALIDATE_GATE, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 02/43] tcg: fix corruption of code_time profiling counter upon tb_flush, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 28/43] exec-all: rename tb_free to tb_remove, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 23/43] exec-all: introduce TB_PAGE_ADDR_FMT, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 26/43] exec-all: extract tb->tc_* into a separate struct tc_tb, Emilio G. Cota, 2017/07/19
- [Qemu-devel] [PATCH v3 17/43] target/s390x: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/19