[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b2d63bf-56cd-e8f5-e8ee-2891c2c1be8f@kernel.org>
Date: Thu, 29 Aug 2019 11:01:08 -0600
From: shuah <shuah@...nel.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
Joe Perches <joe@...ches.com>
Cc: kunit-dev@...glegroups.com, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, frowand.list@...il.com,
sboyd@...nel.org, pmladek@...e.com, sergey.senozhatsky@...il.com,
rostedt@...dmis.org, Randy Dunlap <rdunlap@...radead.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
shuah <shuah@...nel.org>
Subject: Re: [PATCH v2] kunit: fix failure to build without printk
On 8/28/19 3:49 AM, Sergey Senozhatsky wrote:
> On (08/28/19 02:31), Brendan Higgins wrote:
> [..]
>> Previously KUnit assumed that printk would always be present, which is
>> not a valid assumption to make. Fix that by removing call to
>> vprintk_emit, and calling printk directly.
>>
>> Reported-by: Randy Dunlap <rdunlap@...radead.org>
>> Link: https://lore.kernel.org/linux-kselftest/0352fae9-564f-4a97-715a-fabe016259df@kernel.org/T/#t
>> Cc: Stephen Rothwell <sfr@...b.auug.org.au>
>> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
>> Signed-off-by: Brendan Higgins <brendanhiggins@...gle.com>
>
> [..]
>
>> -static void kunit_vprintk(const struct kunit *test,
>> - const char *level,
>> - struct va_format *vaf)
>> -{
>> - kunit_printk_emit(level[1] - '0', "\t# %s: %pV", test->name, vaf);
>> -}
>
> This patch looks good to me. I like the removal of recursive
> vsprintf() (%pV).
>
> -ss
>
Hi Sergey,
What are the guidelines for using printk(). I recall some discussion
about not using printk(). I am seeing the following from checkpatch
script:
WARNING: Prefer [subsystem eg: netdev]_level([subsystem]dev, ... then
dev_level(dev, ... then pr_level(... to printk(KERN_LEVEL ...
#105: FILE: include/kunit/test.h:343:
+ printk(KERN_LEVEL "\t# %s: " fmt, (test)->name, ##__VA_ARGS__)
Is there supposed to be pr_level() - I can find dev_level()
cc'ing Joe Perches for his feedback on this message recommending
pr_level() which isn't in 5.3.
thanks,
-- Shuah
thanks,
-- Shuah
Powered by blists - more mailing lists