diff options
author | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-06-04 19:46:24 +0800 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-06-04 19:46:24 +0800 |
commit | 29a3e1ef73daaa91cbf5cce2fb475f1878254402 (patch) | |
tree | fbd1df992706a4786633a7986a31b9cf78b3dced /kernel/debug/debug_core.c | |
parent | 564119271649aa2d1840e79badf743e957b497e6 (diff) | |
parent | 3c16bd7bb0a2b00b71f65bb0075e0c94d0fcc777 (diff) |
Merge Linaro Android branch ' jstultz/linaro-android-3.4
' into integration-android-ux500
Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
Diffstat (limited to 'kernel/debug/debug_core.c')
-rw-r--r-- | kernel/debug/debug_core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 0557f24c6bc..35b94acec62 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -85,6 +85,10 @@ static int kgdb_use_con; bool dbg_is_early = true; /* Next cpu to become the master debug core */ int dbg_switch_cpu; +/* Flag for entering kdb when a panic occurs */ +static bool break_on_panic = true; +/* Flag for entering kdb when an exception occurs */ +static bool break_on_exception = true; /* Use kdb or gdbserver mode */ int dbg_kdb_mode = 1; @@ -99,6 +103,8 @@ early_param("kgdbcon", opt_kgdb_con); module_param(kgdb_use_con, int, 0644); module_param(kgdbreboot, int, 0644); +module_param(break_on_panic, bool, 0644); +module_param(break_on_exception, bool, 0644); /* * Holds information about breakpoints in a kernel. These breakpoints are @@ -673,6 +679,9 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs) struct kgdb_state kgdb_var; struct kgdb_state *ks = &kgdb_var; + if (unlikely(signo != SIGTRAP && !break_on_exception)) + return 1; + ks->cpu = raw_smp_processor_id(); ks->ex_vector = evector; ks->signo = signo; @@ -759,6 +768,9 @@ static int kgdb_panic_event(struct notifier_block *self, unsigned long val, void *data) { + if (!break_on_panic) + return NOTIFY_DONE; + if (dbg_kdb_mode) kdb_printf("PANIC: %s\n", (char *)data); kgdb_breakpoint(); |