Commit 4da75b9ceac6939cd76830ec9581bef5bb398ad3

Authored by Jason Wessel
1 parent ae6bf53e02

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>

Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff

... ... @@ -1365,6 +1365,7 @@
1365 1365 int sstep_tries = 100;
1366 1366 int error = 0;
1367 1367 int i, cpu;
  1368 + int trace_on = 0;
1368 1369 acquirelock:
1369 1370 /*
1370 1371 * Interrupts will be restored by the 'trap return' code, except when
... ... @@ -1399,6 +1400,8 @@
1399 1400 */
1400 1401 if (arch_kgdb_ops.correct_hw_break)
1401 1402 arch_kgdb_ops.correct_hw_break();
  1403 + if (trace_on)
  1404 + tracing_on();
1402 1405 atomic_dec(&cpu_in_kgdb[cpu]);
1403 1406 touch_softlockup_watchdog_sync();
1404 1407 clocksource_touch_watchdog();
... ... @@ -1474,6 +1477,9 @@
1474 1477 kgdb_single_step = 0;
1475 1478 kgdb_contthread = current;
1476 1479 exception_level = 0;
  1480 + trace_on = tracing_is_on();
  1481 + if (trace_on)
  1482 + tracing_off();
1477 1483  
1478 1484 /* Talk to debugger with gdbserial protocol */
1479 1485 error = gdb_serial_stub(ks);
... ... @@ -1505,6 +1511,8 @@
1505 1511 else
1506 1512 kgdb_sstep_pid = 0;
1507 1513 }
  1514 + if (trace_on)
  1515 + tracing_on();
1508 1516 /* Free kgdb_active */
1509 1517 atomic_set(&kgdb_active, -1);
1510 1518 touch_softlockup_watchdog_sync();