mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 3/4] Add BUG() debugger entry points Build Option
@ 2016-01-29 18:19 Jeffrey Merkey
  0 siblings, 0 replies; only message in thread
From: Jeffrey Merkey @ 2016-01-29 18:19 UTC (permalink / raw)
  To: akpm, aryabinin, dan.j.williams, dave, linux-kernel, mingo,
	nikolay, paulmck, vladimir.murzin

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>
---
 lib/Kconfig.debug | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 041f995..073a37f 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -326,6 +326,17 @@ config SECTION_MISMATCH_WARN_ONLY
 # is preferred to always offer frame pointers as a config
 # option on the architecture (regardless of KERNEL_DEBUG):
 #
+config DEBUG_BREAK
+	bool "Set Breakpoint for Kernel BUGs"
+	depends on DEBUG_KERNEL && !S390
+	help
+	  Say Y here to enable the kernel to emit a breakpoint instruction
+	  anywhere a BUG() macro has been placed in the system kernel code
+	  intended to catch bugs.
+
+	  This option is used for triggering the OS to try enter a debugger
+	  if one is presently installed on the system.
+
 config ARCH_WANT_FRAME_POINTERS
 	bool
 	help
-- 
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:19 [PATCH 3/4] Add BUG() debugger entry points Build Option Jeffrey Merkey

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

Powered by JetHome