diff mbox series

[v2] gcov: fix when CONFIG_MODULES is not set

Message ID 20190329181839.139301-1-ndesaulniers@google.com
State New
Headers show
Series [v2] gcov: fix when CONFIG_MODULES is not set | expand

Commit Message

Nick Desaulniers March 29, 2019, 6:18 p.m. UTC
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: Randy Dunlap <rdunlap@infradead.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 | 4 ++++
 kernel/gcov/gcc_4_7.c | 4 ++++
 2 files changed, 8 insertions(+)

-- 
2.21.0.392.gf8f6787159e-goog

Comments

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


There is a certain format for Fixes: and that's not quite it. :(

> 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: Randy Dunlap <rdunlap@infradead.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>


Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested


Thanks.

> ---

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

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

>  2 files changed, 8 insertions(+)

> 

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

> index 801ee4b0b969..8fc30f178351 100644

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

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

> @@ -146,7 +146,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)

>   */

>  bool gcov_info_within_module(struct gcov_info *info, struct module *mod)

>  {

> +#ifdef CONFIG_MODULES

>  	return within_module((unsigned long)info, mod);

> +#else

> +	return false;

> +#endif

>  }

>  

>  /* Symbolic links to be created for each profiling data file. */

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

> index ec37563674d6..0b6886d4a4dd 100644

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

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

> @@ -159,7 +159,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)

>   */

>  bool gcov_info_within_module(struct gcov_info *info, struct module *mod)

>  {

> +#ifdef CONFIG_MODULES

>  	return within_module((unsigned long)info, mod);

> +#else

> +	return false;

> +#endif

>  }

>  

>  /* Symbolic links to be created for each profiling data file. */

> 



-- 
~Randy
Tri Vo March 30, 2019, 11:57 p.m. UTC | #2
On Fri, Mar 29, 2019 at 1:53 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>

> On 3/29/19 11:18 AM, Nick Desaulniers wrote:

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

>

> There is a certain format for Fixes: and that's not quite it. :(

>

> > 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: Randy Dunlap <rdunlap@infradead.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>

>

> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

>

> Thanks.

>

> > ---

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

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

> >  2 files changed, 8 insertions(+)


Thanks for taking a look at this Nick! I believe same fix should be
applied to kernel/gcov/clang.c. I'll send out an updated version later
today.
Nick Desaulniers April 2, 2019, 2:54 a.m. UTC | #3
On Sun, Mar 31, 2019 at 6:57 AM Tri Vo <trong@android.com> wrote:
>

> On Fri, Mar 29, 2019 at 1:53 PM Randy Dunlap <rdunlap@infradead.org> wrote:

> >

> > On 3/29/19 11:18 AM, Nick Desaulniers wrote:

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

> >

> > There is a certain format for Fixes: and that's not quite it. :(


Looks like the format is:
Fixes: <first 12 characters of commit sha> ("<first line of commit>")
so:
Fixes: 8c3d220cb6b5 ("gcov: clang support")

We should update:
https://www.kernel.org/doc/html/v5.0/process/stable-kernel-rules.html
to include this information.

> Thanks for taking a look at this Nick! I believe same fix should be

> applied to kernel/gcov/clang.c. I'll send out an updated version later

> today.


All yours, happy to review.

-- 
Thanks,
~Nick Desaulniers
Matthew Wilcox April 3, 2019, 3:24 p.m. UTC | #4
On Tue, Apr 02, 2019 at 09:54:50AM +0700, Nick Desaulniers wrote:
> Looks like the format is:

> Fixes: <first 12 characters of commit sha> ("<first line of commit>")

> so:

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

> 

> We should update:

> https://www.kernel.org/doc/html/v5.0/process/stable-kernel-rules.html

> to include this information.


It's in Documentation/process/submitting-patches.rst already.
diff mbox series

Patch

diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c
index 801ee4b0b969..8fc30f178351 100644
--- a/kernel/gcov/gcc_3_4.c
+++ b/kernel/gcov/gcc_3_4.c
@@ -146,7 +146,11 @@  void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
 	return within_module((unsigned long)info, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index ec37563674d6..0b6886d4a4dd 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -159,7 +159,11 @@  void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
 	return within_module((unsigned long)info, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */