Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1323701
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options |
| Date | 2016-02-02 03:10 +0100 |
| Message-ID | <qXyzL-3LF-3@gated-at.bofh.it> (permalink) |
| References | <qXweC-1Qr-5@gated-at.bofh.it> <qXweC-1Qr-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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, ...) \
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v4 4/4] pr_emerg add WARN_XX() debugger options Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-02-02 00:40 +0100
Re: [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-02-02 03:10 +0100
Re: [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options "Maciej W. Rozycki" <macro@linux-mips.org> - 2016-02-02 20:50 +0100
Re: [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-02-02 23:20 +0100
Re: [PATCH v4 4/4] pr_emerg add WARN_XX() debugger options Steven Rostedt <rostedt@goodmis.org> - 2016-02-02 03:10 +0100
csiph-web