[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160216090138.GA3902@pd.tnic>
Date: Tue, 16 Feb 2016 10:01:38 +0100
From: Borislav Petkov <bp@...en8.de>
To: Ingo Molnar <mingo@...nel.org>
Cc: Chen Yucong <slaoub@...il.com>, tglx@...utronix.de, hpa@...or.com,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level>
On Tue, Feb 16, 2016 at 09:24:31AM +0100, Ingo Molnar wrote:
> Hm, so I suspect the other patch I already applied is buggy as well?
Yap.
pr_debug() is ugly to use:
/* If you are writing a driver, please use dev_dbg instead */
#if defined(CONFIG_DYNAMIC_DEBUG)
/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
#define pr_debug(fmt, ...) \
dynamic_pr_debug(fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define pr_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#else
#define pr_debug(fmt, ...) \
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#endif
so in the !CONFIG_DYNAMIC_DEBUG case, you want to boot with "ignore_loglevel"
and see all those debug statements but that can't work because you have to
rebuild and slap a
#define DEBUG
somewhere *before* all includes.
Which is clearly dumb.
FWIW, that pr_debug() should have been defined without the
defined(DEBUG) conditional in order to be an equivalent conversion like
the rest of the pr_* gunk.
I propose we add
pr_debug_i_mean_it()
and use *that* instead. :-)
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
Powered by blists - more mailing lists