stacktrace: Remove weak version of save_stack_trace_tsk_reliable() [Linux 5.3]

This Linux kernel change "stacktrace: Remove weak version of save_stack_trace_tsk_reliable()" is included in the Linux 5.3 release. This change is authored by Miroslav Benes <mbenes [at]> on Tue Jun 11 16:13:18 2019 +0200. The commit for this change in Linux stable tree is 380178e (patch).

stacktrace: Remove weak version of save_stack_trace_tsk_reliable()

Recent rework of stack trace infrastructure introduced a new set of
helpers for common stack trace operations (commit e9b98e162aa5
("stacktrace: Provide helpers for common stack trace operations") and
related). As a result, save_stack_trace_tsk_reliable() is not directly
called anywhere. Livepatch, currently the only user of the reliable
stack trace feature, now calls stack_trace_save_tsk_reliable().

When CONFIG_HAVE_RELIABLE_STACKTRACE is set and depending on
CONFIG_ARCH_STACKWALK, stack_trace_save_tsk_reliable() calls either
arch_stack_walk_reliable() or mentioned save_stack_trace_tsk_reliable().
x86_64 defines the former, ppc64le the latter. All other architectures
do not have HAVE_RELIABLE_STACKTRACE and include/linux/stacktrace.h
defines -ENOSYS returning version for them.

In short, stack_trace_save_tsk_reliable() returning -ENOSYS defined in
include/linux/stacktrace.h serves the same purpose as the old weak
version of save_stack_trace_tsk_reliable() which is therefore no longer

Signed-off-by: Miroslav Benes <>
Acked-by: Josh Poimboeuf <>
Reviewed-by: Thomas Gleixner <>
Reviewed-by: Kamalesh Babulal <>
Signed-off-by: Petr Mladek <>

There are 8 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 kernel/stacktrace.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index 27bafc1..319e7fc 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -254,14 +254,6 @@ unsigned int stack_trace_save_user(unsigned long *store, unsigned int size)
    WARN_ONCE(1, KERN_INFO "save_stack_trace_regs() not implemented yet.\n");

-__weak int
-save_stack_trace_tsk_reliable(struct task_struct *tsk,
-                 struct stack_trace *trace)
-   WARN_ONCE(1, KERN_INFO "save_stack_tsk_reliable() not implemented yet.\n");
-   return -ENOSYS;
  * stack_trace_save - Save a stack trace into a storage array
  * @store: Pointer to storage array

Leave a Reply

Your email address will not be published. Required fields are marked *