[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4f8cfc41d4b7f9f76a403767cfc28d5ffafc1ee.camel@perches.com>
Date: Thu, 28 May 2020 10:08:18 -0700
From: Joe Perches <joe@...ches.com>
To: Petr Mladek <pmladek@...e.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Dmitry Vyukov <dvyukov@...gle.com>,
Ondrej Mosnacek <omosnace@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into
printk(KERN_DEBUG)
On Thu, 2020-05-28 at 14:14 +0200, Petr Mladek wrote:
> On Thu 2020-05-28 20:33:10, Tetsuo Handa wrote:
> > On 2020/05/28 19:59, Petr Mladek wrote:
> > > 2. Add twist into vprintk_store(). In the current, implementation
> > > it would do:
> > >
> > > #if TWIST
> > > return text_len;
> > > #endif
> > >
> > > return log_output(facility, level, lflags,
> > > dict, dictlen, text, text_len);
> >
> > This part could be possible. But
> >
> > > 1. Add twist into ddebug_add_module() and enable all newly added
> > > entries by default. For example, by calling
> > > ddebug_exec_query("*:+p", const char *modname) or what is the syntax.
> > >
> > > This will cause that any pr_devel() variant will always get called.
> >
> > how to handle
> >
> > > > #define no_printk(fmt, ...) \
> > > > ({ \
> > > > if (0) \
> > > > printk(fmt, ##__VA_ARGS__); \
> > > > 0; \
> > > > })
> >
> > part used by e.g. pr_devel() ? Since this macro is not using dynamic debug
> > interface, vprintk_store() will not be called from the beginning. Are you
> > suggesting that we should convert no_printk() to use dynamic debug interface ?
>
> OK, this is one more path that would need special handling. Two paths
> are much better than 15.
A few more:
$ grep-2.5.4 --include=*.[ch] -rP '\if\s*\(\s*0\s*\)\s*\{?\s*\\?\s*no_printk' *
drivers/platform/x86/thinkpad_acpi.c: do { if (0) no_printk(format, ##arg); } while (0)
fs/ntfs/debug.h: if (0) \
no_printk(fmt, ##__VA_ARGS__); \
include/linux/net.h: if (0) \
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
kernel/cred.c: if (0) \
no_printk("[%-5.5s%5u] " FMT "\n", \
Powered by blists - more mailing lists