Commit ed49f7fd authored by Breno Leitao's avatar Breno Leitao Committed by Michael Ellerman

powerpc/xmon: Disable tracing when entering xmon

If tracing is enabled and you get into xmon, the tracing buffer
continues to be updated, causing possible loss of data and unnecessary
tracing information coming from xmon functions.

This patch simple disables tracing when entering xmon, and re-enables it
if the kernel is resumed (with 'x').
Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Acked-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 4125d012
...@@ -89,6 +89,7 @@ static unsigned long nidump = 16; ...@@ -89,6 +89,7 @@ static unsigned long nidump = 16;
static unsigned long ncsum = 4096; static unsigned long ncsum = 4096;
static int termch; static int termch;
static char tmpstr[128]; static char tmpstr[128];
static int tracing_enabled;
static long bus_error_jmp[JMP_BUF_LEN]; static long bus_error_jmp[JMP_BUF_LEN];
static int catch_memory_errors; static int catch_memory_errors;
...@@ -462,6 +463,9 @@ static int xmon_core(struct pt_regs *regs, int fromipi) ...@@ -462,6 +463,9 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
local_irq_save(flags); local_irq_save(flags);
hard_irq_disable(); hard_irq_disable();
tracing_enabled = tracing_is_on();
tracing_off();
bp = in_breakpoint_table(regs->nip, &offset); bp = in_breakpoint_table(regs->nip, &offset);
if (bp != NULL) { if (bp != NULL) {
regs->nip = bp->address + offset; regs->nip = bp->address + offset;
...@@ -982,6 +986,8 @@ cmds(struct pt_regs *excp) ...@@ -982,6 +986,8 @@ cmds(struct pt_regs *excp)
break; break;
case 'x': case 'x':
case 'X': case 'X':
if (tracing_enabled)
tracing_on();
return cmd; return cmd;
case EOF: case EOF:
printf(" <no input ...>\n"); printf(" <no input ...>\n");
...@@ -2241,8 +2247,6 @@ static void dump_tracing(void) ...@@ -2241,8 +2247,6 @@ static void dump_tracing(void)
ftrace_dump(DUMP_ORIG); ftrace_dump(DUMP_ORIG);
else else
ftrace_dump(DUMP_ALL); ftrace_dump(DUMP_ALL);
tracing_on();
} }
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment