mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeffrey Merkey <jeffmerkey@gmail.com>
To: akpm@linux-foundation.org, atomlin@redhat.com,
	cmetcalf@ezchip.com, dzickus@redhat.com, fweisbec@gmail.com,
	hidehiro.kawai.ez@hitachi.com, linux-kernel@vger.kernel.org,
	mhocko@suse.cz, tj@kernel.org, uobergfe@redhat.com
Subject: [PATCH 1/4] Add BUG() debugger entry points
Date: Fri, 29 Jan 2016 11:18:55 -0700	[thread overview]
Message-ID: <1454091535-12683-1-git-send-email-jeffmerkey@gmail.com> (raw)

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

                 reply	other threads:[~2016-01-29 18:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454091535-12683-1-git-send-email-jeffmerkey@gmail.com \
    --to=jeffmerkey@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@redhat.com \
    --cc=cmetcalf@ezchip.com \
    --cc=dzickus@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hidehiro.kawai.ez@hitachi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=tj@kernel.org \
    --cc=uobergfe@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®