From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>
Subject: [Qemu-devel] [PATCH v2 7/7] qemu-log: add nochain option to disable TB chaining
Date: Fri, 28 Mar 2014 16:43:27 +0000 [thread overview]
Message-ID: <1396025007-27592-8-git-send-email-alex.bennee@linaro.org> (raw)
In-Reply-To: <1396025007-27592-1-git-send-email-alex.bennee@linaro.org>
The current exec and cpu flags only show information when we enter a
TranslationBlock. The blocks will then chain together until there is a
reason to exit which can make things harder to follow. This new option
disables the chaining for debugging purposes.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
diff --git a/cpu-exec.c b/cpu-exec.c
index abe02b7..c20349c 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -620,8 +620,10 @@ int cpu_exec(CPUArchState *env)
}
/* see if we can patch the calling TB. When the TB
spans two pages, we cannot safely do a direct
- jump. */
- if (next_tb != 0 && tb->page_addr[1] == -1) {
+ jump. It can also complicate tracing so disable if
+ asked (but be aware this can change behaviour). */
+ if (next_tb != 0 && tb->page_addr[1] == -1 &&
+ !qemu_loglevel_mask (CPU_LOG_TB_NOCHAIN)) {
tb_add_jump((TranslationBlock *)(next_tb & ~TB_EXIT_MASK),
next_tb & TB_EXIT_MASK, tb);
}
diff --git a/include/qemu/log.h b/include/qemu/log.h
index f6cef9e..82902b0 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -40,6 +40,7 @@ static inline bool qemu_log_enabled(void)
#define CPU_LOG_RESET (1 << 9)
#define LOG_UNIMP (1 << 10)
#define LOG_GUEST_ERROR (1 << 11)
+#define CPU_LOG_TB_NOCHAIN (1 << 12)
/* Returns true if a bit is set in the current loglevel mask
*/
diff --git a/qemu-log.c b/qemu-log.c
index a54b332..dc78a93 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -175,6 +175,8 @@ const QEMULogItem qemu_log_items[] = {
{ LOG_GUEST_ERROR, "guest_errors",
"log when the guest OS does something invalid (eg accessing a\n"
"non-existent register)" },
+ { CPU_LOG_TB_NOCHAIN, "nochain",
+ "disable chaining of translation blocks (better tracing, but slower)" },
{ 0, NULL, NULL },
};
--
1.9.1
next prev parent reply other threads:[~2014-03-28 16:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 16:43 [Qemu-devel] [PATCH v2 0/7] qemu-log: various fixes and enhancements Alex Bennée
2014-03-28 16:43 ` [Qemu-devel] [PATCH v2 1/7] qemu-log: correct help text for -d cpu Alex Bennée
2014-03-28 16:43 ` [Qemu-devel] [PATCH v2 2/7] qemu-log: Avoid function call for disabled qemu_log_mask logging Alex Bennée
2014-03-28 16:43 ` [Qemu-devel] [PATCH v2 3/7] qemu-log: Improve the "exec" TB execution logging Alex Bennée
2014-03-28 16:43 ` [Qemu-devel] [PATCH v2 4/7] qemu-log: support simple pid substitution in logfile Alex Bennée
2014-03-28 16:43 ` [Qemu-devel] [PATCH v2 5/7] qemu-log: new option -dfilter to limit output Alex Bennée
2014-03-28 16:43 ` [Qemu-devel] [PATCH v2 6/7] qemu-log: dfilter-ise exec, in_asm, out_asm, and op_opt Alex Bennée
2014-03-28 16:43 ` Alex Bennée [this message]
2014-03-28 17:34 ` [Qemu-devel] [PATCH v2 7/7] qemu-log: add nochain option to disable TB chaining Peter Maydell
2014-03-28 17:47 ` Alex Bennée
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=1396025007-27592-8-git-send-email-alex.bennee@linaro.org \
--to=alex.bennee@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).