Skip to contentSkip to conversation

optprobes: fix kconfig depends/selects

PATCH In review Randy Dunlap 3 participants 15 messages Aug 12, 2010 – Sep 13, 2010 Linux-next tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 optprobes: fix kconfig depends/selects

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)
arch/Kconfig +2 -0
@@ -45,6 +45,8 @@ config OPTPROBES
 	def_bool y
 	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
+	depends on DEBUG_KERNEL
+	select KALLSYMS
 	select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
#1 lore raw
Quoted 4 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

Indeed, Thanks for pointing it!

Quoted 23 lines

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)
arch/Kconfig +2 -0
@@ -45,6 +45,8 @@ config OPTPROBES
 	def_bool y
 	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
+	depends on DEBUG_KERNEL
+	select KALLSYMS
 	select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
#2 lore raw
Quoted 9 lines · Masami Hiramatsu
Quoted 4 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

Indeed, Thanks for pointing it!

Oops, I meant;

Sorry:(

Quoted 25 lines
Quoted 23 lines

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)
arch/Kconfig +2 -0
@@ -45,6 +45,8 @@ config OPTPROBES
 	def_bool y
 	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
+	depends on DEBUG_KERNEL
+	select KALLSYMS
 	select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
#3 lore raw
In reply to Randy Dunlap
Quoted 26 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>

---
 arch/Kconfig |    2 ++

 1 file changed, 2 insertions(+)
arch/Kconfig +0 -0
@@ -45,6 +45,8 @@ config OPTPROBES

       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL

Quoted 2 lines

 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

arch/Kconfig:33:error: recursive dependency detected!
arch/Kconfig:33: symbol KPROBES depends on KALLSYMS
init/Kconfig:825: symbol KALLSYMS is selected by OPTPROBES
arch/Kconfig:44: symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Signature · 1 line
Felipe Contreras
#4 lore raw
Quoted 32 lines · Felipe Contreras
Quoted 19 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc:     Ananth N Mavinakayanahalli <[email protected]>
Cc:     Anil S Keshavamurthy <[email protected]>
Cc:     "David S. Miller" <[email protected]>
Cc:     Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

arch/Kconfig config OPTPROBES

Quoted 9 lines
arch/Kconfig +2 -1
@@ -45,6 +45,8 @@ config OPTPROBES
       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

Quoted 8 lines

arch/Kconfig:33:error: recursive dependency detected!
arch/Kconfig:33: symbol KPROBES depends on KALLSYMS
init/Kconfig:825: symbol KALLSYMS is selected by OPTPROBES
arch/Kconfig:44: symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Thanks for checking. I saw this problem just a day or two ago myself.

Dropping the select does not eliminate the kconfig warning. I'll try something else.

Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
#5 lore raw
Quoted 38 lines · Randy Dunlap
Quoted 37 lines · Felipe Contreras
Quoted 26 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>

---
 arch/Kconfig |    2 ++

 1 file changed, 2 insertions(+)
arch/Kconfig +0 -0
@@ -45,6 +45,8 @@ config OPTPROBES

       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL

Quoted 2 lines

 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

arch/Kconfig:33:error: recursive dependency detected! arch/Kconfig:33:      symbol KPROBES depends on KALLSYMS init/Kconfig:825:     symbol KALLSYMS is selected by OPTPROBES arch/Kconfig:44:      symbol OPTPROBES depends on KPROBES

Quoted 8 lines
Quoted 3 lines

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Thanks for checking.  I saw this problem just a day or two ago myself.

Dropping the select does not eliminate the kconfig warning. I'll try something else.

Huh? The original warning is gone by just adding 'depends on DEBUG_KERNEL'.

Signature · 1 line
Felipe Contreras
#6 lore raw
Quoted 41 lines · On Sun, 12 Sep 2010 21:41:07 +0300 Felipe Contreras wrote:
Quoted 40 lines · Randy Dunlap
Quoted 39 lines · Felipe Contreras
Quoted 26 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>

---
 arch/Kconfig |    2 ++

 1 file changed, 2 insertions(+)
arch/Kconfig +0 -0
@@ -45,6 +45,8 @@ config OPTPROBES

       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL

Quoted 2 lines

 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

arch/Kconfig:33:error: recursive dependency detected! arch/Kconfig:33:      symbol KPROBES depends on KALLSYMS init/Kconfig:825:     symbol KALLSYMS is selected by OPTPROBES arch/Kconfig:44:      symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Thanks for checking.  I saw this problem just a day or two ago myself.

Dropping the select does not eliminate the kconfig warning. I'll try something else.

Huh? The original warning is gone by just adding 'depends on DEBUG_KERNEL'.

not so in my testing.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#7 lore raw
In reply to Felipe Contreras
Quoted 32 lines · Felipe Contreras
Quoted 19 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc:     Ananth N Mavinakayanahalli <[email protected]>
Cc:     Anil S Keshavamurthy <[email protected]>
Cc:     "David S. Miller" <[email protected]>
Cc:     Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

arch/Kconfig config OPTPROBES

Quoted 9 lines
arch/Kconfig +2 -1
@@ -45,6 +45,8 @@ config OPTPROBES
       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

Quoted 9 lines

arch/Kconfig:33:error: recursive dependency detected!
arch/Kconfig:33: symbol KPROBES depends on KALLSYMS
init/Kconfig:825: symbol KALLSYMS is selected by OPTPROBES
arch/Kconfig:44: symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Thanks, let me clear the dependency;
Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS and CONFIG_KALLSYMS_ALL.
Optprobe is a optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Anyway, since optprobe itself is depends on kprobes, it doesn't need to select both of KALLSYMS/KALLSYMS_ALL.

Thank you,

Signature · 4 lines
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: [email protected]
#8 lore raw
Quoted 43 lines · Masami Hiramatsu
Quoted 32 lines · Felipe Contreras
Quoted 19 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc:     Ananth N Mavinakayanahalli <[email protected]>
Cc:     Anil S Keshavamurthy <[email protected]>
Cc:     "David S. Miller" <[email protected]>
Cc:     Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

arch/Kconfig config OPTPROBES

Quoted 9 lines
arch/Kconfig +2 -1
@@ -45,6 +45,8 @@ config OPTPROBES
       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

Quoted 9 lines

arch/Kconfig:33:error: recursive dependency detected!
arch/Kconfig:33: symbol KPROBES depends on KALLSYMS
init/Kconfig:825: symbol KALLSYMS is selected by OPTPROBES
arch/Kconfig:44: symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Quoted 8 lines

Thanks, let me clear the dependency;
Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS and CONFIG_KALLSYMS_ALL.
Optprobe is a optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Anyway, since optprobe itself is depends on kprobes, it doesn't need to select both of KALLSYMS/KALLSYMS_ALL.

Hmm, wait, I might misunderstand something here. I thought KALLSYMS_ALL added symbols of static functions.
But, does KALLSYMS_ALL just add symbols of variables? If so, both of KPROBES and OPTPROBES require only KALLSYMS. It means that they don't need to care about CONFIG_DEBUG_KERNEL.

Thank you,

Signature · 4 lines
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: [email protected]
#9 lore raw
Quoted 53 lines · Masami Hiramatsu
Quoted 43 lines · Masami Hiramatsu
Quoted 32 lines · Felipe Contreras
Quoted 26 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>

---
 arch/Kconfig |    2 ++

 1 file changed, 2 insertions(+)
arch/Kconfig +0 -0
@@ -45,6 +45,8 @@ config OPTPROBES

       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL

Quoted 2 lines

 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

Quoted 9 lines

arch/Kconfig:33:error: recursive dependency detected! arch/Kconfig:33:     symbol KPROBES depends on KALLSYMS init/Kconfig:825:    symbol KALLSYMS is selected by OPTPROBES arch/Kconfig:44:     symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Quoted 8 lines

Thanks, let me clear the dependency;
Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS and CONFIG_KALLSYMS_ALL.
Optprobe is a optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Anyway, since optprobe itself is depends on kprobes, it doesn't need to select both of KALLSYMS/KALLSYMS_ALL.

Quoted 5 lines

Hmm, wait, I might misunderstand something here. I thought KALLSYMS_ALL added symbols of static functions.
But, does KALLSYMS_ALL just add symbols of variables? If so, both of KPROBES and OPTPROBES require only KALLSYMS. It means that they don't need to care about CONFIG_DEBUG_KERNEL.

So:
- select KALLSYMS_ALL
+ depends on KALLSYMS_ALL

Because KALLSYMS_ALL depends on DEBUG_KERNEL && KALLSYMS.

Signature · 1 line
Felipe Contreras
#10 lore raw
Quoted 65 lines · Felipe Contreras
Quoted 53 lines · Masami Hiramatsu
Quoted 43 lines · Masami Hiramatsu
Quoted 32 lines · Felipe Contreras
Quoted 19 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc:     Ananth N Mavinakayanahalli <[email protected]>
Cc:     Anil S Keshavamurthy <[email protected]>
Cc:     "David S. Miller" <[email protected]>
Cc:     Masami Hiramatsu <[email protected]>
---
 arch/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

arch/Kconfig config OPTPROBES

Quoted 9 lines
arch/Kconfig +2 -1
@@ -45,6 +45,8 @@ config OPTPROBES
       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

Quoted 9 lines

arch/Kconfig:33:error: recursive dependency detected!

arch/Kconfig:33:     symbol KPROBES depends on KALLSYMS
init/Kconfig:825:    symbol KALLSYMS is selected by OPTPROBES
arch/Kconfig:44:     symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Quoted 8 lines

Thanks, let me clear the dependency;
Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS and CONFIG_KALLSYMS_ALL.
Optprobe is a optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Anyway, since optprobe itself is depends on kprobes, it doesn't need to select both of KALLSYMS/KALLSYMS_ALL.

Quoted 5 lines

Hmm, wait, I might misunderstand something here. I thought KALLSYMS_ALL added symbols of static functions.
But, does KALLSYMS_ALL just add symbols of variables? If so, both of KPROBES and OPTPROBES require only KALLSYMS. It means that they don't need to care about CONFIG_DEBUG_KERNEL.

So:

(quoted diff) +1 -1
-       select KALLSYMS_ALL
+       depends on KALLSYMS_ALL
Quoted 1 line

Because KALLSYMS_ALL depends on DEBUG_KERNEL && KALLSYMS.

No, what I meant is;
- select KALLSYMS_ALL

:-)

Signature · 4 lines
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: [email protected]
#11 lore raw
Quoted 66 lines · Masami Hiramatsu
Quoted 65 lines · Felipe Contreras
Quoted 53 lines · Masami Hiramatsu
Quoted 43 lines · Masami Hiramatsu
Quoted 32 lines · Felipe Contreras
Quoted 26 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

KALLSYMS and KALLSYMS_ALL depend on DEBUG_KERNEL, so add that dependency. KALLSYMS_ALL depends on KALLSYMS, so select both of them, not just KALLSYMS_ALL.

warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Masami Hiramatsu <[email protected]>

---
 arch/Kconfig |    2 ++

 1 file changed, 2 insertions(+)
arch/Kconfig +0 -0
@@ -45,6 +45,8 @@ config OPTPROBES

       def_bool y
       depends on KPROBES && HAVE_OPTPROBES
       depends on !PREEMPT
+       depends on DEBUG_KERNEL
+       select KALLSYMS
       select KALLSYMS_ALL

Quoted 2 lines

 config HAVE_EFFICIENT_UNALIGNED_ACCESS
--

This causes another problem:

Quoted 9 lines

arch/Kconfig:33:error: recursive dependency detected! arch/Kconfig:33:     symbol KPROBES depends on KALLSYMS init/Kconfig:825:    symbol KALLSYMS is selected by OPTPROBES arch/Kconfig:44:     symbol OPTPROBES depends on KPROBES

The 'select KALLSYMS' is redundant.

Otherwise: Signed-off-by: Felipe Contreras <[email protected]>

Quoted 8 lines

Thanks, let me clear the dependency;
Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS and CONFIG_KALLSYMS_ALL.
Optprobe is a optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Anyway, since optprobe itself is depends on kprobes, it doesn't need to select both of KALLSYMS/KALLSYMS_ALL.

Quoted 5 lines

Hmm, wait, I might misunderstand something here. I thought KALLSYMS_ALL added symbols of static functions.
But, does KALLSYMS_ALL just add symbols of variables? If so, both of KPROBES and OPTPROBES require only KALLSYMS. It means that they don't need to care about CONFIG_DEBUG_KERNEL.

So:
-       select KALLSYMS_ALL
+       depends on KALLSYMS_ALL

Quoted 6 lines
Quoted 1 line

Because KALLSYMS_ALL depends on DEBUG_KERNEL && KALLSYMS.

No, what I meant is;
-       select KALLSYMS_ALL

:-)

Ohh, I didn't notice the _ALL. Makes sense.

Signature · 1 line
Felipe Contreras
#12 lore raw

PATCH 1/1 kprobes: Fix Kconfig dependency

In reply to Masami Hiramatsu

Fix Kconfig dependency among Kprobes, optprobe and kallsyms.

Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS.

Optprobe is an optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Since KALLSYMS_ALL just adds symbols of kernel variables, it doesn't need to select KALLSYMS_ALL.

Cc Felipe Contreras <[email protected]>
Cc Randy Dunlap <[email protected]>,
Cc Ananth N Mavinakayanahalli <[email protected]>,
Cc Anil S Keshavamurthy <[email protected]>,
Cc "David S. Miller" <[email protected]>,

---

 arch/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/Kconfig +2 -2
index 4877a8c..fe48fc7 100644
@@ -32,8 +32,9 @@ config HAVE_OPROFILE
 
 config KPROBES
 	bool "Kprobes"
-	depends on KALLSYMS && MODULES
+	depends on MODULES
 	depends on HAVE_KPROBES
+	select KALLSYMS
 	help
 	  Kprobes allows you to trap at almost any kernel address and
 	  execute a callback function.  register_kprobe() establishes
@@ -45,7 +46,6 @@ config OPTPROBES
 	def_bool y
 	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
-	select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
 	bool
author Acked-by on v1 1/1
#13 lore raw

Re: [PATCH -next,-tip ] kprobes: Fix Kconfig dependency

Quoted 41 lines · Masami Hiramatsu

Fix Kconfig dependency among Kprobes, optprobe and kallsyms.

Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS.

Optprobe is an optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Since KALLSYMS_ALL just adds symbols of kernel variables, it doesn't need to select KALLSYMS_ALL.

Cc Felipe Contreras <[email protected]>
Cc Randy Dunlap <[email protected]>,
Cc Ananth N Mavinakayanahalli <[email protected]>,
Cc Anil S Keshavamurthy <[email protected]>,
Cc "David S. Miller" <[email protected]>,

---

 arch/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/Kconfig +2 -1
index 4877a8c..fe48fc7 100644
@@ -32,8 +32,9 @@ config HAVE_OPROFILE
 
 config KPROBES
 	bool "Kprobes"
-	depends on KALLSYMS && MODULES
+	depends on MODULES
 	depends on HAVE_KPROBES
+	select KALLSYMS
 	help
 	  Kprobes allows you to trap at almost any kernel address and
 	  execute a callback function.  register_kprobe() establishes

arch/Kconfig config OPTPROBES · line 51

Quoted 7 lines
arch/Kconfig +0 -1
@@ -45,7 +46,6 @@ config OPTPROBES
 	def_bool y
 	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
-	select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
 	bool

Fixes the kconfig dependency problem. Thanks.

Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
#14 lore raw

[tip:perf/urgent] kprobes: Fix Kconfig dependency

In reply to Masami Hiramatsu
Commit-ID:  05ed160e89baf7f5fb3432d527fec467d2493626
Gitweb:     http://git.kernel.org/tip/05ed160e89baf7f5fb3432d527fec467d2493626
Author:     Masami Hiramatsu <[email protected]>
AuthorDate: Mon, 13 Sep 2010 19:25:41 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 13 Sep 2010 20:41:31 +0200

kprobes: Fix Kconfig dependency

Fix Kconfig dependency among Kprobes, optprobe and kallsyms.

Kprobes uses kallsyms_lookup for finding target function and checking instruction boundary, thus CONFIG_KPROBES should select CONFIG_KALLSYMS.

Optprobe is an optional feature which is supported on x86 arch, and it also uses kallsyms_lookup for checking instructions in the target function. Since KALLSYMS_ALL just adds symbols of kernel variables, it doesn't need to select KALLSYMS_ALL.

Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Felipe Contreras <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Anil S Keshavamurthy <[email protected]>
Cc David S. Miller <[email protected]>

LKML-Reference: <[email protected]>

---
 arch/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/Kconfig +2 -2
index 4877a8c..fe48fc7 100644
@@ -32,8 +32,9 @@ config HAVE_OPROFILE
 
 config KPROBES
 	bool "Kprobes"
-	depends on KALLSYMS && MODULES
+	depends on MODULES
 	depends on HAVE_KPROBES
+	select KALLSYMS
 	help
 	  Kprobes allows you to trap at almost any kernel address and
 	  execute a callback function.  register_kprobe() establishes
@@ -45,7 +46,6 @@ config OPTPROBES
 	def_bool y
 	depends on KPROBES && HAVE_OPTPROBES
 	depends on !PREEMPT
-	select KALLSYMS_ALL
 
 config HAVE_EFFICIENT_UNALIGNED_ACCESS
 	bool