Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335198

Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level>

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level>
Date 2016-02-16 10:20 +0100
Message-ID <r2JXA-5TU-13@gated-at.bofh.it> (permalink)
References <r1Wk9-69F-3@gated-at.bofh.it> <r25x7-3ED-7@gated-at.bofh.it> <r2Jbc-5ii-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level> Borislav Petkov <bp@alien8.de> - 2016-02-14 15:10 +0100
  Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level> Ingo Molnar <mingo@kernel.org> - 2016-02-16 09:30 +0100
    Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level> Borislav Petkov <bp@alien8.de> - 2016-02-16 10:20 +0100

csiph-web