2019-09-07 05:31:11

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] kunit: add PRINTK dependency

The vprintk_emit() function is not available when CONFIG_PRINTK
is disabled:

kunit/test.c:22:9: error: implicit declaration of function 'vprintk_emit' [-Werror,-Wimplicit-function-declaration]

I suppose without printk(), there is not much use in kunit
either, so add a Kconfig depenedency here.

Signed-off-by: Arnd Bergmann <[email protected]>
---
kunit/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/kunit/Kconfig b/kunit/Kconfig
index 8541ef95b65a..e80d8af00454 100644
--- a/kunit/Kconfig
+++ b/kunit/Kconfig
@@ -6,6 +6,7 @@ menu "KUnit support"

config KUNIT
bool "Enable support for unit tests (KUnit)"
+ depends on PRINTK
help
Enables support for kernel unit tests (KUnit), a lightweight unit
testing and mocking framework for the Linux kernel. These tests are
--
2.20.0


2019-09-07 06:30:18

by Bird, Tim

[permalink] [raw]
Subject: RE: [PATCH] kunit: add PRINTK dependency

Minor spelling nit..

> -----Original Message-----
> From: Arnd Bergmann
>
> The vprintk_emit() function is not available when CONFIG_PRINTK
> is disabled:
>
> kunit/test.c:22:9: error: implicit declaration of function 'vprintk_emit' [-
> Werror,-Wimplicit-function-declaration]
>
> I suppose without printk(), there is not much use in kunit
> either, so add a Kconfig depenedency here.
depenedency -> dependency

>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> kunit/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kunit/Kconfig b/kunit/Kconfig
> index 8541ef95b65a..e80d8af00454 100644
> --- a/kunit/Kconfig
> +++ b/kunit/Kconfig
> @@ -6,6 +6,7 @@ menu "KUnit support"
>
> config KUNIT
> bool "Enable support for unit tests (KUnit)"
> + depends on PRINTK
> help
> Enables support for kernel unit tests (KUnit), a lightweight unit
> testing and mocking framework for the Linux kernel. These tests are
> --
> 2.20.0

2019-09-07 07:00:03

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH] kunit: add PRINTK dependency

On 9/6/19 9:27 AM, Arnd Bergmann wrote:
> The vprintk_emit() function is not available when CONFIG_PRINTK
> is disabled:
>
> kunit/test.c:22:9: error: implicit declaration of function 'vprintk_emit' [-Werror,-Wimplicit-function-declaration]
>
> I suppose without printk(), there is not much use in kunit
> either, so add a Kconfig depenedency here.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> kunit/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kunit/Kconfig b/kunit/Kconfig
> index 8541ef95b65a..e80d8af00454 100644
> --- a/kunit/Kconfig
> +++ b/kunit/Kconfig
> @@ -6,6 +6,7 @@ menu "KUnit support"
>
> config KUNIT
> bool "Enable support for unit tests (KUnit)"
> + depends on PRINTK
> help
> Enables support for kernel unit tests (KUnit), a lightweight unit
> testing and mocking framework for the Linux kernel. These tests are
>

Hi Arnd,

This is found and fixed already. I am just about to apply Berndan's
patch that fixes this dependency. All of this vprintk_emit() stuff
is redone.

thanks,
-- Shuah

2019-09-07 09:21:53

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] kunit: add PRINTK dependency

On Fri, Sep 6, 2019 at 5:39 PM Shuah Khan <[email protected]> wrote:

> > config KUNIT
> > bool "Enable support for unit tests (KUnit)"
> > + depends on PRINTK
> > help
> > Enables support for kernel unit tests (KUnit), a lightweight unit
> > testing and mocking framework for the Linux kernel. These tests are
> >
>
> Hi Arnd,
>
> This is found and fixed already. I am just about to apply Berndan's
> patch that fixes this dependency. All of this vprintk_emit() stuff
> is redone.

Ok, perfect. Unfortunately I only started testing the coming
linux-next release after Stephen went on his break, so
I'm missing some updates.

Arnd

2019-09-07 09:22:11

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH] kunit: add PRINTK dependency

On 9/6/19 10:02 AM, Arnd Bergmann wrote:
> On Fri, Sep 6, 2019 at 5:39 PM Shuah Khan <[email protected]> wrote:
>
>>> config KUNIT
>>> bool "Enable support for unit tests (KUnit)"
>>> + depends on PRINTK
>>> help
>>> Enables support for kernel unit tests (KUnit), a lightweight unit
>>> testing and mocking framework for the Linux kernel. These tests are
>>>
>>
>> Hi Arnd,
>>
>> This is found and fixed already. I am just about to apply Berndan's
>> patch that fixes this dependency. All of this vprintk_emit() stuff
>> is redone.
>
> Ok, perfect. Unfortunately I only started testing the coming
> linux-next release after Stephen went on his break, so
> I'm missing some updates.
>

No worries. I am pushing it now - should be there in 5-10 mins.

Please use linuxk-kselftest next.

Let me know if you see any issues. Thanks for testing it.

thanks,
-- Shuah

2019-09-08 10:18:55

by Brendan Higgins

[permalink] [raw]
Subject: Re: [PATCH] kunit: add PRINTK dependency

On Fri, Sep 6, 2019 at 9:08 AM Shuah Khan <[email protected]> wrote:
>
> On 9/6/19 10:02 AM, Arnd Bergmann wrote:
> > On Fri, Sep 6, 2019 at 5:39 PM Shuah Khan <[email protected]> wrote:
> >
> >>> config KUNIT
> >>> bool "Enable support for unit tests (KUnit)"
> >>> + depends on PRINTK
> >>> help
> >>> Enables support for kernel unit tests (KUnit), a lightweight unit
> >>> testing and mocking framework for the Linux kernel. These tests are
> >>>
> >>
> >> Hi Arnd,
> >>
> >> This is found and fixed already. I am just about to apply Berndan's
> >> patch that fixes this dependency. All of this vprintk_emit() stuff
> >> is redone.
> >
> > Ok, perfect. Unfortunately I only started testing the coming
> > linux-next release after Stephen went on his break, so
> > I'm missing some updates.
> >
>
> No worries. I am pushing it now - should be there in 5-10 mins.
>
> Please use linuxk-kselftest next.
>
> Let me know if you see any issues. Thanks for testing it.

Hi Arnd, Shuah accepted my version of the fix earlier today.
Nevertheless, I really appreciate you looking into this. Sorry for
wasting your time.

Please let me know if you run into any additional issues.

Thanks!