Skip to content

Commit cc51514

Browse files
author
Evgenii Shatokhin
committed
Fix the requirements for reliable stack traces
Before this commit, it was assumed that the kernel stack traces were reliable in the following cases: * CONFIG_FRAME_POINTER=y (most of the Linux distros) * CONFIG_STACK_UNWIND=y (old SuSE distros) The current distros with the kernels 4.19+ usually have either CONFIG_UNWINDER_FRAME_POINTER=y (Ubuntu, etc.) or CONFIG_UNWINDER_ORC=y (RHEL 8, SuSE, Debian, ...), the stack traces should be reliable in both cases. Take this into account and do not fail the build of KEDR. #49 Signed-off-by: Evgenii Shatokhin <[email protected]>
1 parent 31e086a commit cc51514

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sources/cmake/kmodule_sources/check_stack_trace/module.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ MODULE_LICENSE("GPL");
1010
* CONFIG_STACKTRACE). If stack traces are reliable but save_stack_trace()
1111
* cannot be used, there are alternatives but this is another story. */
1212

13-
#if !defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_UNWIND_INFO) && \
14-
!defined(CONFIG_STACK_UNWIND)
15-
#error Stack trace data can be unreliable on this system.
13+
#if !defined(CONFIG_FRAME_POINTER) && \
14+
!defined(CONFIG_UNWIND_INFO) && \
15+
!defined(CONFIG_STACK_UNWIND) && \
16+
!defined(CONFIG_UNWINDER_FRAME_POINTER) && \
17+
!defined(CONFIG_UNWINDER_ORC)
18+
#error Stack traces might be unreliable.
1619
#endif
1720

1821
#if !defined(CONFIG_STACKTRACE)

sources/cmake/modules/kmodule.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ macro(check_stack_trace)
206206
message (FATAL_ERROR
207207
"It looks like reliable stack traces cannot be obtained on this system. "
208208
"Please rebuild the kernel with CONFIG_STACKTRACE=y and "
209-
"CONFIG_FRAME_POINTER=y or CONFIG_STACK_UNWIND=y (if available) "
209+
"CONFIG_UNWINDER_FRAME_POINTER=y or CONFIG_UNWINDER_ORC=y "
210210
"and then reconfigure and rebuild KEDR.")
211211
endif (NOT STACK_TRACE_RELIABLE)
212212
endmacro(check_stack_trace)

0 commit comments

Comments
 (0)