[tip: sched/core] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following commit has been merged into the sched/core branch of tip:

Commit-ID:     037495eb8133281667b6dbc98912086825015286
Gitweb:        https://git.kernel.org/tip/037495eb8133281667b6dbc98912086825015286
Author:        Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate:    Fri, 22 Oct 2021 09:40:27 +02:00
Committer:     Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 22 Oct 2021 09:40:27 +02:00

stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too

The following commit:

  bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")

Added stack_trace_save_tsk() use to __get_wchan(), while this method is not
unconditionally defined: it's not available in the !CONFIG_STACKTRACE case.

Give a default implementation that does nothing.

Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Fixes: bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")
Cc: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
 include/linux/stacktrace.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 9edecb4..3ccaf59 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -91,8 +91,19 @@ extern void save_stack_trace_tsk(struct task_struct *tsk,
 extern int save_stack_trace_tsk_reliable(struct task_struct *tsk,
 					 struct stack_trace *trace);
 extern void save_stack_trace_user(struct stack_trace *trace);
+
 #endif /* !CONFIG_ARCH_STACKWALK */
-#endif /* CONFIG_STACKTRACE */
+
+#else /* !CONFIG_STACKTRACE: */
+static inline unsigned int
+stack_trace_save_tsk(struct task_struct *task,
+		     unsigned long *store, unsigned int size,
+		     unsigned int skipnr)
+{
+	return -ENOSYS;
+}
+
+#endif /* !CONFIG_STACKTRACE */
 
 #if defined(CONFIG_STACKTRACE) && defined(CONFIG_HAVE_RELIABLE_STACKTRACE)
 int stack_trace_save_tsk_reliable(struct task_struct *tsk, unsigned long *store,



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux