From: Steven Rostedt <rostedt@goodmis.org>
To: Jeffrey Merkey <jeffmerkey@gmail.com>
Cc: linux-kernel@vger.kernel.org, Jason@zx2c4.com,
aconole@redhat.com, akpm@linux-foundation.org,
andriy.shevchenko@linux.intel.com, linus.walleij@linaro.org,
nicolas.iooss_linux@m4x.org, pmladek@suse.com, tj@kernel.org
Subject: Re: [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options
Date: Mon, 1 Feb 2016 20:58:10 -0500 [thread overview]
Message-ID: <20160201205810.59250879@grimm.local.home> (raw)
In-Reply-To: <1454369752-20706-4-git-send-email-jeffmerkey@gmail.com>
On Mon, 1 Feb 2016 16:35:52 -0700
Jeffrey Merkey <jeffmerkey@gmail.com> wrote:
> ---
> include/linux/printk.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/printk.h b/include/linux/printk.h
> index 51dd6b8..dcfb270 100644
> --- a/include/linux/printk.h
> +++ b/include/linux/printk.h
> @@ -252,8 +252,16 @@ extern asmlinkage void dump_stack(void) __cold;
> * and other debug macros are compiled out unless either DEBUG is defined
> * or CONFIG_DYNAMIC_DEBUG is set.
> */
> +#ifdef CONFIG_DEBUG_WARN
> +#define pr_emerg(fmt, ...) \
> +({ \
> + printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__); \
> + BUG(); \
This look rather heavy handed for a debug feature. This will crash any
kernel on a pr-emerg(), similar to a panic on warning. Not only that,
for cases that cal pr_emerg() more than once, it crashes on the first
instance.
What about adding a condition that can be set set in /proc/sys/kernel/
A file called something like crash_on_print_emerg ?
BUG_ON(crash_on_pr_emerg);
-- Steve
> +})
> +#else
> #define pr_emerg(fmt, ...) \
> printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
> +#endif
> #define pr_alert(fmt, ...) \
> printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
> #define pr_crit(fmt, ...) \
next prev parent reply other threads:[~2016-02-02 2:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 23:35 [PATCH v4 1/4] Add BUG_XX() debugging options Jeffrey Merkey
2016-02-01 23:35 ` [PATCH v4 2/4] Add WARN_XX() " Jeffrey Merkey
2016-02-01 23:35 ` [PATCH v4 3/4] Add BUG_XX() and " Jeffrey Merkey
2016-02-01 23:35 ` [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options Jeffrey Merkey
2016-02-02 1:58 ` Steven Rostedt [this message]
2016-02-02 2:01 ` Jeffrey Merkey
2016-02-02 19:40 ` Maciej W. Rozycki
2016-02-02 22:18 ` Jeffrey Merkey
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=20160201205810.59250879@grimm.local.home \
--to=rostedt@goodmis.org \
--cc=Jason@zx2c4.com \
--cc=aconole@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jeffmerkey@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.iooss_linux@m4x.org \
--cc=pmladek@suse.com \
--cc=tj@kernel.org \
/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