diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-04-02 12:57:18 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-04-02 15:58:19 -0400 |
commit | 4da75b9ceac6939cd76830ec9581bef5bb398ad3 (patch) | |
tree | 5b4880b07563d13bd17753d0891aae8d8fe77e4d /kernel/kgdb.c | |
parent | ae6bf53e0255c8ab04b6fe31806e318432570e3c (diff) |
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: Jason Wessel <jason.wessel@windriver.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/kgdb.c')
-rw-r--r-- | kernel/kgdb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/kgdb.c b/kernel/kgdb.c index 2f7f454605c2..11f3515ca83f 100644 --- a/kernel/kgdb.c +++ b/kernel/kgdb.c | |||
@@ -1365,6 +1365,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) | |||
1365 | int sstep_tries = 100; | 1365 | int sstep_tries = 100; |
1366 | int error = 0; | 1366 | int error = 0; |
1367 | int i, cpu; | 1367 | int i, cpu; |
1368 | int trace_on = 0; | ||
1368 | acquirelock: | 1369 | acquirelock: |
1369 | /* | 1370 | /* |
1370 | * Interrupts will be restored by the 'trap return' code, except when | 1371 | * Interrupts will be restored by the 'trap return' code, except when |
@@ -1399,6 +1400,8 @@ return_normal: | |||
1399 | */ | 1400 | */ |
1400 | if (arch_kgdb_ops.correct_hw_break) | 1401 | if (arch_kgdb_ops.correct_hw_break) |
1401 | arch_kgdb_ops.correct_hw_break(); | 1402 | arch_kgdb_ops.correct_hw_break(); |
1403 | if (trace_on) | ||
1404 | tracing_on(); | ||
1402 | atomic_dec(&cpu_in_kgdb[cpu]); | 1405 | atomic_dec(&cpu_in_kgdb[cpu]); |
1403 | touch_softlockup_watchdog_sync(); | 1406 | touch_softlockup_watchdog_sync(); |
1404 | clocksource_touch_watchdog(); | 1407 | clocksource_touch_watchdog(); |
@@ -1474,6 +1477,9 @@ return_normal: | |||
1474 | kgdb_single_step = 0; | 1477 | kgdb_single_step = 0; |
1475 | kgdb_contthread = current; | 1478 | kgdb_contthread = current; |
1476 | exception_level = 0; | 1479 | exception_level = 0; |
1480 | trace_on = tracing_is_on(); | ||
1481 | if (trace_on) | ||
1482 | tracing_off(); | ||
1477 | 1483 | ||
1478 | /* Talk to debugger with gdbserial protocol */ | 1484 | /* Talk to debugger with gdbserial protocol */ |
1479 | error = gdb_serial_stub(ks); | 1485 | error = gdb_serial_stub(ks); |
@@ -1505,6 +1511,8 @@ kgdb_restore: | |||
1505 | else | 1511 | else |
1506 | kgdb_sstep_pid = 0; | 1512 | kgdb_sstep_pid = 0; |
1507 | } | 1513 | } |
1514 | if (trace_on) | ||
1515 | tracing_on(); | ||
1508 | /* Free kgdb_active */ | 1516 | /* Free kgdb_active */ |
1509 | atomic_set(&kgdb_active, -1); | 1517 | atomic_set(&kgdb_active, -1); |
1510 | touch_softlockup_watchdog_sync(); | 1518 | touch_softlockup_watchdog_sync(); |