gcov: include linux/module.h for within_module

Message ID 20190329174541.79972-1-ndesaulniers@google.com
State New
Headers show
Series
  • gcov: include linux/module.h for within_module
Related show

Commit Message

Nick Desaulniers March 29, 2019, 5:45 p.m.
Fixes commit 8c3d220cb6b5 ("gcov: clang support")

Cc: Greg Hackmann <ghackmann@android.com>
Cc: Tri Vo <trong@android.com>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: linux-mm@kvack.org
Cc: kbuild-all@01.org
Reported-by: kbuild test robot <lkp@intel.com>
Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

---
 kernel/gcov/gcc_3_4.c | 1 +
 kernel/gcov/gcc_4_7.c | 1 +
 2 files changed, 2 insertions(+)

-- 
2.21.0.392.gf8f6787159e-goog

Comments

Randy Dunlap March 29, 2019, 6:01 p.m. | #1
On 3/29/19 10:45 AM, Nick Desaulniers wrote:
> Fixes commit 8c3d220cb6b5 ("gcov: clang support")

> 

> Cc: Greg Hackmann <ghackmann@android.com>

> Cc: Tri Vo <trong@android.com>

> Cc: Peter Oberparleiter <oberpar@linux.ibm.com>

> Cc: linux-mm@kvack.org

> Cc: kbuild-all@01.org

> Reported-by: kbuild test robot <lkp@intel.com>

> Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2

> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>


Reported-by: Randy Dunlap <rdunlap@infradead.org>
see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%25akpm@linux-foundation.org/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

Did you test this?  kernel/gcov/gcc_4_7.c includes local "gcov.h",
which includes <linux/module.h>, so why didn't that work or why
does this patch work?

thanks.

> ---

>  kernel/gcov/gcc_3_4.c | 1 +

>  kernel/gcov/gcc_4_7.c | 1 +

>  2 files changed, 2 insertions(+)

> 

> diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c

> index 801ee4b0b969..0eda59ef57df 100644

> --- a/kernel/gcov/gcc_3_4.c

> +++ b/kernel/gcov/gcc_3_4.c

> @@ -16,6 +16,7 @@

>   */

>  

>  #include <linux/errno.h>

> +#include <linux/module.h>

>  #include <linux/slab.h>

>  #include <linux/string.h>

>  #include <linux/seq_file.h>

> diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c

> index ec37563674d6..677851284fe2 100644

> --- a/kernel/gcov/gcc_4_7.c

> +++ b/kernel/gcov/gcc_4_7.c

> @@ -13,6 +13,7 @@

>   */

>  

>  #include <linux/errno.h>

> +#include <linux/module.h>

>  #include <linux/slab.h>

>  #include <linux/string.h>

>  #include <linux/seq_file.h>

> 



-- 
~Randy
Randy Dunlap March 29, 2019, 6:08 p.m. | #2
On 3/29/19 11:01 AM, Randy Dunlap wrote:
> On 3/29/19 10:45 AM, Nick Desaulniers wrote:

>> Fixes commit 8c3d220cb6b5 ("gcov: clang support")

>>

>> Cc: Greg Hackmann <ghackmann@android.com>

>> Cc: Tri Vo <trong@android.com>

>> Cc: Peter Oberparleiter <oberpar@linux.ibm.com>

>> Cc: linux-mm@kvack.org

>> Cc: kbuild-all@01.org

>> Reported-by: kbuild test robot <lkp@intel.com>

>> Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2

>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

> 

> Reported-by: Randy Dunlap <rdunlap@infradead.org>

> see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%25akpm@linux-foundation.org/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

> 

> Did you test this?  kernel/gcov/gcc_4_7.c includes local "gcov.h",

> which includes <linux/module.h>, so why didn't that work or why

> does this patch work?


No, this patch does not fix the build error for me.

> thanks.

> 

>> ---

>>  kernel/gcov/gcc_3_4.c | 1 +

>>  kernel/gcov/gcc_4_7.c | 1 +

>>  2 files changed, 2 insertions(+)

>>

>> diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c

>> index 801ee4b0b969..0eda59ef57df 100644

>> --- a/kernel/gcov/gcc_3_4.c

>> +++ b/kernel/gcov/gcc_3_4.c

>> @@ -16,6 +16,7 @@

>>   */

>>  

>>  #include <linux/errno.h>

>> +#include <linux/module.h>

>>  #include <linux/slab.h>

>>  #include <linux/string.h>

>>  #include <linux/seq_file.h>

>> diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c

>> index ec37563674d6..677851284fe2 100644

>> --- a/kernel/gcov/gcc_4_7.c

>> +++ b/kernel/gcov/gcc_4_7.c

>> @@ -13,6 +13,7 @@

>>   */

>>  

>>  #include <linux/errno.h>

>> +#include <linux/module.h>

>>  #include <linux/slab.h>

>>  #include <linux/string.h>

>>  #include <linux/seq_file.h>

>>

> 

> 



-- 
~Randy
Nick Desaulniers March 29, 2019, 6:09 p.m. | #3
On Fri, Mar 29, 2019 at 11:01 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>

> On 3/29/19 10:45 AM, Nick Desaulniers wrote:

> > Fixes commit 8c3d220cb6b5 ("gcov: clang support")

> >

> > Cc: Greg Hackmann <ghackmann@android.com>

> > Cc: Tri Vo <trong@android.com>

> > Cc: Peter Oberparleiter <oberpar@linux.ibm.com>

> > Cc: linux-mm@kvack.org

> > Cc: kbuild-all@01.org

> > Reported-by: kbuild test robot <lkp@intel.com>

> > Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2

> > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

>

> Reported-by: Randy Dunlap <rdunlap@infradead.org>

> see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%25akpm@linux-foundation.org/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

>

> Did you test this?


Yes, built with gcc 7.3 and
defconfig
+
CONFIG_GCOV_KERNEL=y
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_GCOV_FORMAT_4_7=y

> kernel/gcov/gcc_4_7.c includes local "gcov.h",

> which includes <linux/module.h>, so why didn't that work or why

> does this patch work?


Good point. May be something in the configs from 0-day bot.  Boarding
a plane for Bangkok, but can dig further once landed.

Maybe module support was disabled?

--
Thanks,
~Nick Desaulniers
Randy Dunlap March 29, 2019, 6:10 p.m. | #4
On 3/29/19 11:09 AM, Nick Desaulniers wrote:
> On Fri, Mar 29, 2019 at 11:01 AM Randy Dunlap <rdunlap@infradead.org> wrote:

>>

>> On 3/29/19 10:45 AM, Nick Desaulniers wrote:

>>> Fixes commit 8c3d220cb6b5 ("gcov: clang support")

>>>

>>> Cc: Greg Hackmann <ghackmann@android.com>

>>> Cc: Tri Vo <trong@android.com>

>>> Cc: Peter Oberparleiter <oberpar@linux.ibm.com>

>>> Cc: linux-mm@kvack.org

>>> Cc: kbuild-all@01.org

>>> Reported-by: kbuild test robot <lkp@intel.com>

>>> Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2

>>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

>>

>> Reported-by: Randy Dunlap <rdunlap@infradead.org>

>> see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%25akpm@linux-foundation.org/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

>>

>> Did you test this?

> 

> Yes, built with gcc 7.3 and

> defconfig

> +

> CONFIG_GCOV_KERNEL=y

> CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y

> CONFIG_GCOV_FORMAT_4_7=y

> 

>> kernel/gcov/gcc_4_7.c includes local "gcov.h",

>> which includes <linux/module.h>, so why didn't that work or why

>> does this patch work?

> 

> Good point. May be something in the configs from 0-day bot.  Boarding

> a plane for Bangkok, but can dig further once landed.

> 

> Maybe module support was disabled?


Yes, I reported the problem with CONFIG_MODULES not enabled.


-- 
~Randy

Patch

diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c
index 801ee4b0b969..0eda59ef57df 100644
--- a/kernel/gcov/gcc_3_4.c
+++ b/kernel/gcov/gcc_3_4.c
@@ -16,6 +16,7 @@ 
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index ec37563674d6..677851284fe2 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -13,6 +13,7 @@ 
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>