Skip to content

Commit de3db3f

Browse files
LiHua-ProbeParkerakpm00
authored andcommitted
test_kprobes: fix implicit declaration error of test_kprobes
If KPROBES_SANITY_TEST and ARCH_CORRECT_STACKTRACE_ON_KRETPROBE is enabled, but STACKTRACE is not set. Build failed as below: lib/test_kprobes.c: In function `stacktrace_return_handler': lib/test_kprobes.c:228:8: error: implicit declaration of function `stack_trace_save'; did you mean `stacktrace_driver'? [-Werror=implicit-function-declaration] ret = stack_trace_save(stack_buf, STACK_BUF_SIZE, 0); ^~~~~~~~~~~~~~~~ stacktrace_driver cc1: all warnings being treated as errors scripts/Makefile.build:250: recipe for target 'lib/test_kprobes.o' failed make[2]: *** [lib/test_kprobes.o] Error 1 To fix this error, Select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE is enabled. Link: https://lkml.kernel.org/r/[email protected] Fixes: 1f6d3a8 ("kprobes: Add a test case for stacktrace from kretprobe handler") Signed-off-by: Li Hua <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Cc: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 512c5ca commit de3db3f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Kconfig.debug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,6 +2107,7 @@ config KPROBES_SANITY_TEST
21072107
depends on DEBUG_KERNEL
21082108
depends on KPROBES
21092109
depends on KUNIT
2110+
select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
21102111
default KUNIT_ALL_TESTS
21112112
help
21122113
This option provides for testing basic kprobes functionality on

0 commit comments

Comments
 (0)