mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/4] Add BUG() debugger entry points
@ 2016-01-29 18:18 Jeffrey Merkey
  0 siblings, 0 replies; only message in thread
From: Jeffrey Merkey @ 2016-01-29 18:18 UTC (permalink / raw)
  To: akpm, atomlin, cmetcalf, dzickus, fweisbec, hidehiro.kawai.ez,
	linux-kernel, mhocko, tj, uobergfe

This patch series adds a config option which can be set during compile to
direct the compiler to output a breakpoint instruction anywhere a BUG()
macro has been placed in the kernel to trigger the system to enter a
debugger if a bug is detected by the system.  Use of this compile time
option also allows conditional breakpoints to be set anywhere in the
kernel.

This addition is extremely useful for debugging hard and soft lockups
real time and quickly from a console debugger, and other areas of the
kernel.

Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
---
 kernel/watchdog.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index b3ace6e..6de9263 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -358,6 +358,9 @@ static void watchdog_overflow_callback(struct perf_event *event,
 		else
 			dump_stack();
 
+#ifdef CONFIG_DEBUG_BREAK
+		BUG();
+#endif
 		/*
 		 * Perform all-CPU dump only once to avoid multiple hardlockups
 		 * generating interleaving traces
@@ -478,6 +481,9 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
 		else
 			dump_stack();
 
+#ifdef CONFIG_DEBUG_BREAK
+		BUG();
+#endif
 		if (softlockup_all_cpu_backtrace) {
 			/* Avoid generating two back traces for current
 			 * given that one is already made above
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-29 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 18:18 [PATCH 1/4] Add BUG() debugger entry points Jeffrey Merkey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®