diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2020-09-10 12:15:04 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2020-10-03 04:25:14 -0500 |
commit | 4c389f6edf4a6bbdbc3dbcd7c4d639d868d0cf0c (patch) | |
tree | 154fe3eee670f58542de95ccb88d5f3fb15fa5a0 /accel/tcg | |
parent | bcf368626cb33c4d8bf1c0c8fd1dcafb3c9f8d53 (diff) | |
download | qemu-4c389f6edf4a6bbdbc3dbcd7c4d639d868d0cf0c.zip qemu-4c389f6edf4a6bbdbc3dbcd7c4d639d868d0cf0c.tar.gz qemu-4c389f6edf4a6bbdbc3dbcd7c4d639d868d0cf0c.tar.bz2 |
disas: Move host asm annotations to tb_gen_code
Instead of creating GStrings and passing them into log_disas,
just print the annotations directly in tb_gen_code.
Fix the annotations for the slow paths of the TB, after the
part implementing the final guest instruction.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel/tcg')
-rw-r--r-- | accel/tcg/translate-all.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index f44ba9d..e82fc35 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1816,10 +1816,9 @@ TranslationBlock *tb_gen_code(CPUState *cpu, qemu_log_in_addr_range(tb->pc)) { FILE *logfile = qemu_log_lock(); int code_size, data_size = 0; - g_autoptr(GString) note = g_string_new("[tb header & initial instruction]"); - size_t chunk_start = 0; + size_t chunk_start; int insn = 0; - qemu_log("OUT: [size=%d]\n", gen_code_size); + if (tcg_ctx->data_gen_ptr) { code_size = tcg_ctx->data_gen_ptr - tb->tc.ptr; data_size = gen_code_size - code_size; @@ -1828,26 +1827,33 @@ TranslationBlock *tb_gen_code(CPUState *cpu, } /* Dump header and the first instruction */ + qemu_log("OUT: [size=%d]\n", gen_code_size); + qemu_log(" -- guest addr 0x" TARGET_FMT_lx " + tb prologue\n", + tcg_ctx->gen_insn_data[insn][0]); chunk_start = tcg_ctx->gen_insn_end_off[insn]; - log_disas(tb->tc.ptr, chunk_start, note->str); + log_disas(tb->tc.ptr, chunk_start); /* * Dump each instruction chunk, wrapping up empty chunks into * the next instruction. The whole array is offset so the * first entry is the beginning of the 2nd instruction. */ - while (insn <= tb->icount && chunk_start < code_size) { + while (insn < tb->icount) { size_t chunk_end = tcg_ctx->gen_insn_end_off[insn]; if (chunk_end > chunk_start) { - g_string_printf(note, "[guest addr: " TARGET_FMT_lx "]", - tcg_ctx->gen_insn_data[insn][0]); - log_disas(tb->tc.ptr + chunk_start, chunk_end - chunk_start, - note->str); + qemu_log(" -- guest addr 0x" TARGET_FMT_lx "\n", + tcg_ctx->gen_insn_data[insn][0]); + log_disas(tb->tc.ptr + chunk_start, chunk_end - chunk_start); chunk_start = chunk_end; } insn++; } + if (chunk_start < code_size) { + qemu_log(" -- tb slow paths + alignment\n"); + log_disas(tb->tc.ptr + chunk_start, code_size - chunk_start); + } + /* Finally dump any data we may have after the block */ if (data_size) { int i; |