linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chase Douglas <chase.douglas@canonical.com>
To: linux-kernel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Randy Dunlap <randy.dunlap@oracle.com>
Subject: [PATCH 2/3] Add tracing_off_event() calls to BUG() and WARN() paths
Date: Wed, 14 Apr 2010 12:20:15 -0400	[thread overview]
Message-ID: <1271262016-18650-2-git-send-email-chase.douglas@canonical.com> (raw)
In-Reply-To: <1271262016-18650-1-git-send-email-chase.douglas@canonical.com>

This change adds tracing_off_event() calls, which stop debug tracing,
when a BUG() or WARN() function is called. The stoppage depends on
commandline paramenter tracing_off={bug,warn,none}. The default is
"bug", so only the BUG() paths will stop tracing.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
---
 kernel/panic.c |    4 +++-
 lib/bug.c      |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 13d966b..f0ff321 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -319,7 +319,7 @@ int oops_may_print(void)
  */
 void oops_enter(void)
 {
-	tracing_off();
+	tracing_off_event(TRACE_EVENT_BUG);
 	/* can't trust the integrity of the kernel anymore: */
 	debug_locks_off();
 	do_oops_enter_exit();
@@ -369,6 +369,8 @@ static void warn_slowpath_common(const char *file, int line, void *caller, struc
 {
 	const char *board;
 
+	tracing_off_event(TRACE_EVENT_WARN);
+
 	printk(KERN_WARNING "------------[ cut here ]------------\n");
 	printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
 	board = dmi_get_system_info(DMI_PRODUCT_NAME);
diff --git a/lib/bug.c b/lib/bug.c
index 300e41a..457c1eb 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -154,6 +154,8 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
 		warning = (bug->flags & BUGFLAG_WARNING) != 0;
 	}
 
+	tracing_off_event(warning ? TRACE_EVENT_WARN : TRACE_EVENT_BUG);
+
 	if (warning) {
 		/* this is a WARN_ON rather than BUG/BUG_ON */
 		if (file)
-- 
1.7.0


  reply	other threads:[~2010-04-14 16:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 16:20 [PATCH 1/3 v4] Add tracing_off_event() to stop tracing when a bug or warning occur Chase Douglas
2010-04-14 16:20 ` Chase Douglas [this message]
2010-04-15 20:57   ` [PATCH 2/3] Add tracing_off_event() calls to BUG() and WARN() paths Frederic Weisbecker
2010-04-15 21:49     ` Chase Douglas
2010-04-15 23:15       ` Frederic Weisbecker
2010-04-16  4:13         ` Chase Douglas
2010-04-14 16:20 ` [PATCH 3/3] Stop tracing on a schedule bug Chase Douglas
2010-04-15 21:03   ` Frederic Weisbecker
2010-04-15 21:45     ` Chase Douglas
2010-04-15 23:01       ` Thomas Gleixner
2010-04-15 23:10         ` Frederic Weisbecker
2010-04-15 23:27         ` Chase Douglas
2010-04-15 23:50           ` Thomas Gleixner
2010-04-16  0:21             ` Thomas Gleixner
2010-04-16  1:49               ` Frederic Weisbecker
2010-04-16 16:41                 ` Steven Rostedt
2010-04-16  4:01               ` Chase Douglas
2010-04-16 16:46                 ` Steven Rostedt
2010-04-16 17:14                   ` Chase Douglas
2010-04-16 18:14                   ` Frederic Weisbecker
2010-04-16 19:58                   ` Thomas Gleixner
2010-04-19 22:30               ` Chase Douglas
2010-04-16  3:52             ` Chase Douglas
2010-04-15 20:13 ` [PATCH 1/3 v4] Add tracing_off_event() to stop tracing when a bug or warning occur Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2010-03-18 13:48 [PATCH 1/3] " Chase Douglas
2010-03-18 13:48 ` [PATCH 2/3] Add tracing_off_event() calls to BUG() and WARN() paths Chase Douglas

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=1271262016-18650-2-git-send-email-chase.douglas@canonical.com \
    --to=chase.douglas@canonical.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=randy.dunlap@oracle.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).