cpu-exec: Add "nochain" debug flag
authorRichard Henderson <rth@twiddle.net>
Wed, 16 Sep 2015 22:33:53 +0000 (15:33 -0700)
committerRichard Henderson <rth@twiddle.net>
Mon, 19 Oct 2015 21:04:39 +0000 (11:04 -1000)
Respect it to avoid linking TBs together.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
cpu-exec.c
include/qemu/log.h
qemu-log.c

index 8fd56a69e0857c6fc06f8975b694dfe94f18e417..7eef0830fe8f55bab2a022e0a03703c197abe0f7 100644 (file)
@@ -477,7 +477,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);
                 }
index f880e66dbc796d378fb11a8d1783a288986e2584..7de45001f2d7887a9c54b102332b25538fe71198 100644 (file)
@@ -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
  */
index 13f3813f68aecd5895c545a7759e5e096a04bedf..efd07c81eaf98a9939c1886ccbb97bba9c9d6dd9 100644 (file)
@@ -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 },
 };