提交 4da75b9c 编写于 作者: J Jason Wessel

kgdb: Turn off tracing while in the debugger

The kernel debugger should turn off kernel tracing any time the
debugger is active and restore it on resume.
Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
上级 ae6bf53e
...@@ -1365,6 +1365,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -1365,6 +1365,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
int sstep_tries = 100; int sstep_tries = 100;
int error = 0; int error = 0;
int i, cpu; int i, cpu;
int trace_on = 0;
acquirelock: acquirelock:
/* /*
* Interrupts will be restored by the 'trap return' code, except when * Interrupts will be restored by the 'trap return' code, except when
...@@ -1399,6 +1400,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -1399,6 +1400,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
*/ */
if (arch_kgdb_ops.correct_hw_break) if (arch_kgdb_ops.correct_hw_break)
arch_kgdb_ops.correct_hw_break(); arch_kgdb_ops.correct_hw_break();
if (trace_on)
tracing_on();
atomic_dec(&cpu_in_kgdb[cpu]); atomic_dec(&cpu_in_kgdb[cpu]);
touch_softlockup_watchdog_sync(); touch_softlockup_watchdog_sync();
clocksource_touch_watchdog(); clocksource_touch_watchdog();
...@@ -1474,6 +1477,9 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -1474,6 +1477,9 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
kgdb_single_step = 0; kgdb_single_step = 0;
kgdb_contthread = current; kgdb_contthread = current;
exception_level = 0; exception_level = 0;
trace_on = tracing_is_on();
if (trace_on)
tracing_off();
/* Talk to debugger with gdbserial protocol */ /* Talk to debugger with gdbserial protocol */
error = gdb_serial_stub(ks); error = gdb_serial_stub(ks);
...@@ -1505,6 +1511,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -1505,6 +1511,8 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
else else
kgdb_sstep_pid = 0; kgdb_sstep_pid = 0;
} }
if (trace_on)
tracing_on();
/* Free kgdb_active */ /* Free kgdb_active */
atomic_set(&kgdb_active, -1); atomic_set(&kgdb_active, -1);
touch_softlockup_watchdog_sync(); touch_softlockup_watchdog_sync();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册