2023-04-12 10:37:46

by 孙滢

[permalink] [raw]
Subject: [PATCH] trace/recordmcount: add the necessary dependencies

From: Ying Sun <[email protected]>

HAVE_C_RECORDMCOUNT is used only if the condition
"ifdef CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT" is met in the Makefile,
adding a dependency constraint on this configuration option
to prevent it from being set ‘y' but not taking effect.

Suggested-by: Yanjie Ren <[email protected]>
Signed-off-by: Ying Sun <[email protected]>
---
kernel/trace/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 8cf97fa4a4b3..69bb70b6bdd7 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -94,6 +94,7 @@ config HAVE_OBJTOOL_NOP_MCOUNT

config HAVE_C_RECORDMCOUNT
bool
+ depends on FTRACE_MCOUNT_USE_RECORDMCOUNT
help
C version of recordmcount available?

--
2.25.1


2023-04-25 19:19:10

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] trace/recordmcount: add the necessary dependencies

On Wed, 12 Apr 2023 18:18:40 +0800
[email protected] wrote:

> From: Ying Sun <[email protected]>
>
> HAVE_C_RECORDMCOUNT is used only if the condition
> "ifdef CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT" is met in the Makefile,
> adding a dependency constraint on this configuration option
> to prevent it from being set ‘y' but not taking effect.

Why do we care?

The HAVE_* configs are only there to allow architectures to say if they
support it or not. They usually have no effect themselves\ and require
other configs to be enabled something. This is "Works as designed".

-- Steve


>
> Suggested-by: Yanjie Ren <[email protected]>
> Signed-off-by: Ying Sun <[email protected]>
> ---
> kernel/trace/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index 8cf97fa4a4b3..69bb70b6bdd7 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -94,6 +94,7 @@ config HAVE_OBJTOOL_NOP_MCOUNT
>
> config HAVE_C_RECORDMCOUNT
> bool
> + depends on FTRACE_MCOUNT_USE_RECORDMCOUNT
> help
> C version of recordmcount available?
>