* [Qemu-devel] [PATCH] cpu-exec: Add "nochain" debug flag
@ 2015-09-16 22:34 Richard Henderson
2015-09-17 8:35 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2015-09-16 22:34 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
Respect it to avoid linking TBs together.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
cpu-exec.c | 3 ++-
include/qemu/log.h | 1 +
qemu-log.c | 3 +++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index 8945533..b219421 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -527,7 +527,8 @@ int cpu_exec(CPUState *cpu)
/* 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) {
+ 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 f880e66..7de4500 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -41,6 +41,7 @@ static inline bool qemu_log_enabled(void)
#define LOG_UNIMP (1 << 10)
#define LOG_GUEST_ERROR (1 << 11)
#define CPU_LOG_MMU (1 << 12)
+#define CPU_LOG_TB_NOCHAIN (1 << 13)
/* Returns true if a bit is set in the current loglevel mask
*/
diff --git a/qemu-log.c b/qemu-log.c
index 13f3813..efd07c8 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -119,6 +119,9 @@ 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",
+ "do not chain compiled TBs so that \"exec\" and \"cpu\" show\n"
+ "complete traces" },
{ 0, NULL, NULL },
};
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-17 8:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 22:34 [Qemu-devel] [PATCH] cpu-exec: Add "nochain" debug flag Richard Henderson
2015-09-17 8:35 ` Peter Maydell
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).