From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [PULL 3/3] accel/tcg: Add CPU_LOG_EXEC tracing for cpu_io_recompile()
Date: Tue, 27 Oct 2020 09:51:14 -0700 [thread overview]
Message-ID: <20201027165114.71508-4-richard.henderson@linaro.org> (raw)
In-Reply-To: <20201027165114.71508-1-richard.henderson@linaro.org>
From: Peter Maydell <peter.maydell@linaro.org>
When using -icount, it's useful for the CPU_LOG_EXEC logging
to include information about when cpu_io_recompile() was
called, because it alerts the reader of the log that the
tracing of a previous TB execution may not actually
correspond to an actually executed instruction. For instance
if you're using -icount and also -singlestep then a guest
instruction that makes an IO access appears in two
"Trace" lines, once in a TB that triggers the cpu_io_recompile()
and then again in the TB that actually executes.
(This is a similar reason to why the "Stopped execution of
TB chain before..." logging in cpu_tb_exec() is helpful
when trying to track execution flow in the logs.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20201013122658.4620-1-peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/translate-all.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index d76097296d..4572b4901f 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2267,6 +2267,10 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
tb_destroy(tb);
}
+ qemu_log_mask_and_addr(CPU_LOG_EXEC, tb->pc,
+ "cpu_io_recompile: rewound execution of TB to "
+ TARGET_FMT_lx "\n", tb->pc);
+
/* TODO: If env->pc != tb->pc (i.e. the faulting instruction was not
* the first in the TB) then we end up generating a whole new TB and
* repeating the fault, which is horribly inefficient.
--
2.25.1
next prev parent reply other threads:[~2020-10-27 16:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 16:51 [PULL 0/3] tcg patch queue Richard Henderson
2020-10-27 16:51 ` [PULL 1/3] tcg: Do not kill globals at conditional branches Richard Henderson
2020-10-27 16:51 ` [PULL 2/3] tcg/optimize: Flush data at labels not TCG_OPF_BB_END Richard Henderson
2020-10-27 16:51 ` Richard Henderson [this message]
2020-10-31 9:48 ` [PULL 0/3] tcg patch queue Peter Maydell
2020-11-02 13:57 ` Peter Maydell
2020-11-02 16:14 ` Richard Henderson
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=20201027165114.71508-4-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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).