The kernel debugger should turn off kernel tracing any time the
debugger is active and restore it on resume.

CC: Steven Rostedt <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
---
 kernel/debug/debug_core.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 6ca3f7c..464aa65 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -474,6 +474,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct 
pt_regs *regs)
        int sstep_tries = 100;
        int error;
        int i, cpu;
+       int trace_on = 0;
 acquirelock:
        /*
         * Interrupts will be restored by the 'trap return' code, except when
@@ -518,6 +519,8 @@ return_normal:
                         */
                        if (arch_kgdb_ops.correct_hw_break)
                                arch_kgdb_ops.correct_hw_break();
+                       if (trace_on)
+                               tracing_on();
                        atomic_set(&cpu_in_kgdb[cpu], 0);
                        touch_softlockup_watchdog_sync();
                        clocksource_touch_watchdog();
@@ -592,6 +595,9 @@ return_normal:
        kgdb_single_step = 0;
        kgdb_contthread = current;
        exception_level = 0;
+       trace_on = tracing_is_on();
+       if (trace_on)
+               tracing_off();
 
        while (1) {
 cpu_master_loop:
@@ -642,6 +648,8 @@ kgdb_restore:
                else
                        kgdb_sstep_pid = 0;
        }
+       if (trace_on)
+               tracing_on();
        /* Free kgdb_active */
        atomic_set(&kgdb_active, -1);
        touch_softlockup_watchdog_sync();
-- 
1.6.3.1.9.g95405b


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to