Skip to content

Commit

Permalink
cpu-exec: Add "nochain" debug flag
Browse files Browse the repository at this point in the history
Respect it to avoid linking TBs together.

Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
rth7680 committed Oct 19, 2015
1 parent 137d639 commit 89a82cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions include/qemu/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 3 additions & 0 deletions qemu-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};

Expand Down

0 comments on commit 89a82cd

Please sign in to comment.