All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] gcov: fix when CONFIG_MODULES is not set
@ 2019-04-02  3:09 trong
  2019-04-02  4:47 ` Randy Dunlap
  2019-04-03 15:27 ` Matthew Wilcox
  0 siblings, 2 replies; 5+ messages in thread
From: trong @ 2019-04-02  3:09 UTC (permalink / raw)
  To: oberpar, akpm
  Cc: ndesaulniers, ghackmann, linux-mm, kbuild-all, rdunlap, lkp,
	linux-kernel, Tri Vo

From: Tri Vo <trong@android.com>

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

Cc: Greg Hackmann <ghackmann@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>
Signed-off-by: Tri Vo <trong@android.com>
---
 kernel/gcov/clang.c   | 4 ++++
 kernel/gcov/gcc_3_4.c | 4 ++++
 kernel/gcov/gcc_4_7.c | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c
index 125c50397ba2..cfb9ce5e0fed 100644
--- a/kernel/gcov/clang.c
+++ b/kernel/gcov/clang.c
@@ -223,7 +223,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->filename, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
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. */
-- 
2.21.0.392.gf8f6787159e-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] gcov: fix when CONFIG_MODULES is not set
  2019-04-02  3:09 [PATCH v3] gcov: fix when CONFIG_MODULES is not set trong
@ 2019-04-02  4:47 ` Randy Dunlap
  2019-04-03 15:27 ` Matthew Wilcox
  1 sibling, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2019-04-02  4:47 UTC (permalink / raw)
  To: trong, oberpar, akpm
  Cc: ndesaulniers, ghackmann, linux-mm, kbuild-all, lkp, linux-kernel

On 4/1/19 8:09 PM, trong@android.com wrote:
> From: Tri Vo <trong@android.com>
> 
> Fixes: 8c3d220cb6b5 ("gcov: clang support")
> 
> Cc: Greg Hackmann <ghackmann@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>
> Signed-off-by: Tri Vo <trong@android.com>

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

Thanks.

> ---
>  kernel/gcov/clang.c   | 4 ++++
>  kernel/gcov/gcc_3_4.c | 4 ++++
>  kernel/gcov/gcc_4_7.c | 4 ++++
>  3 files changed, 12 insertions(+)
> 
> diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c
> index 125c50397ba2..cfb9ce5e0fed 100644
> --- a/kernel/gcov/clang.c
> +++ b/kernel/gcov/clang.c
> @@ -223,7 +223,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->filename, mod);
> +#else
> +	return false;
> +#endif
>  }
>  
>  /* Symbolic links to be created for each profiling data file. */
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] gcov: fix when CONFIG_MODULES is not set
  2019-04-02  3:09 [PATCH v3] gcov: fix when CONFIG_MODULES is not set trong
  2019-04-02  4:47 ` Randy Dunlap
@ 2019-04-03 15:27 ` Matthew Wilcox
  2019-04-05 17:18     ` Nick Desaulniers
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2019-04-03 15:27 UTC (permalink / raw)
  To: trong
  Cc: oberpar, akpm, ndesaulniers, ghackmann, linux-mm, kbuild-all,
	rdunlap, lkp, linux-kernel

On Tue, Apr 02, 2019 at 10:09:56AM +0700, trong@android.com wrote:
> From: Tri Vo <trong@android.com>
> 
> Fixes: 8c3d220cb6b5 ("gcov: clang support")

I think this is the wrong fix.  Why not simply:

+++ b/include/linux/module.h
@@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
        return false;
 }
 
+static inline bool within_module(unsigned long addr, const struct module *mod)
+{
+       return false;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while (0)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] gcov: fix when CONFIG_MODULES is not set
  2019-04-03 15:27 ` Matthew Wilcox
@ 2019-04-05 17:18     ` Nick Desaulniers
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Desaulniers @ 2019-04-05 17:18 UTC (permalink / raw)
  To: Matthew Wilcox, Andrew Morton
  Cc: Tri Vo, Peter Oberparleiter, Greg Hackmann,
	Linux Memory Management List, kbuild-all, Randy Dunlap,
	kbuild test robot, LKML

On Wed, Apr 3, 2019 at 8:27 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Apr 02, 2019 at 10:09:56AM +0700, trong@android.com wrote:
> > From: Tri Vo <trong@android.com>
> >
> > Fixes: 8c3d220cb6b5 ("gcov: clang support")
>
> I think this is the wrong fix.  Why not simply:

I spoke with Tri quickly about this proposal and we agree it's a better fix.

Andrew, would you mind dropping:
https://ozlabs.org/~akpm/mmotm/broken-out/gcov-clang-support-fix.patch
?

Matthew, would you please send that patch with a commit message?  Or
if you would prefer us to send with your suggested-by tag, we can do
that, too.  Whichever you prefer, please let me know.  Thanks for the
suggestion.

>
> +++ b/include/linux/module.h
> @@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
>         return false;
>  }
>
> +static inline bool within_module(unsigned long addr, const struct module *mod)
> +{
> +       return false;
> +}
> +
>  /* Get/put a kernel symbol (calls should be symmetric) */
>  #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
>  #define symbol_put(x) do { } while (0)
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] gcov: fix when CONFIG_MODULES is not set
@ 2019-04-05 17:18     ` Nick Desaulniers
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Desaulniers @ 2019-04-05 17:18 UTC (permalink / raw)
  To: Matthew Wilcox, Andrew Morton
  Cc: Tri Vo, Peter Oberparleiter, Greg Hackmann,
	Linux Memory Management List, kbuild-all, Randy Dunlap,
	kbuild test robot, LKML

On Wed, Apr 3, 2019 at 8:27 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Apr 02, 2019 at 10:09:56AM +0700, trong@android.com wrote:
> > From: Tri Vo <trong@android.com>
> >
> > Fixes: 8c3d220cb6b5 ("gcov: clang support")
>
> I think this is the wrong fix.  Why not simply:

I spoke with Tri quickly about this proposal and we agree it's a better fix.

Andrew, would you mind dropping:
https://ozlabs.org/~akpm/mmotm/broken-out/gcov-clang-support-fix.patch
?

Matthew, would you please send that patch with a commit message?  Or
if you would prefer us to send with your suggested-by tag, we can do
that, too.  Whichever you prefer, please let me know.  Thanks for the
suggestion.

>
> +++ b/include/linux/module.h
> @@ -709,6 +709,11 @@ static inline bool is_module_text_address(unsigned long addr)
>         return false;
>  }
>
> +static inline bool within_module(unsigned long addr, const struct module *mod)
> +{
> +       return false;
> +}
> +
>  /* Get/put a kernel symbol (calls should be symmetric) */
>  #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
>  #define symbol_put(x) do { } while (0)
>


-- 
Thanks,
~Nick Desaulniers


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-05 17:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02  3:09 [PATCH v3] gcov: fix when CONFIG_MODULES is not set trong
2019-04-02  4:47 ` Randy Dunlap
2019-04-03 15:27 ` Matthew Wilcox
2019-04-05 17:18   ` Nick Desaulniers
2019-04-05 17:18     ` Nick Desaulniers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.