Browse Source

qcacmn: Add process for CONFIG_ARCH_STACKWALK defined condition

When CONFIG_ARCH_STACKWALK is defined, tracing threads function
qdf_print_thread_trace() will do nothing which is wrong.

Fix is to add process for function qdf_print_thread_trace() when
CONFIG_ARCH_STACKWALK is defined. It's the similar implementation
as 'Change-Id: I99643e1b93251de7453f511d13f5a4a39c56f99c'.

Change-Id: I199c3401e08cf91118106959d16c378fa038e3ac
CRs-Fixed: 3618369
Huashan Qu 1 year ago
parent
commit
8b628acc7f
1 changed files with 15 additions and 2 deletions
  1. 15 2
      qdf/linux/src/qdf_threads.c

+ 15 - 2
qdf/linux/src/qdf_threads.c

@@ -196,10 +196,23 @@ qdf_export_symbol(qdf_wake_up_process);
 #if ((defined(WLAN_HOST_ARCH_ARM) && !WLAN_HOST_ARCH_ARM) || \
 	LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) || \
 	defined(BACKPORTED_EXPORT_SAVE_STACK_TRACE_TSK_ARM)) && \
-	defined(CONFIG_STACKTRACE) && !defined(CONFIG_ARCH_STACKWALK)
+	defined(CONFIG_STACKTRACE)
 #define QDF_PRINT_TRACE_COUNT 32
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
+#ifdef CONFIG_ARCH_STACKWALK
+void qdf_print_thread_trace(qdf_thread_t *thread)
+{
+	const int spaces = 4;
+	struct task_struct *task = thread;
+	unsigned long entries[QDF_PRINT_TRACE_COUNT] = {0};
+	unsigned int nr_entries = 0;
+	unsigned int max_entries = QDF_PRINT_TRACE_COUNT;
+	int skip = 0;
+
+	nr_entries = stack_trace_save_tsk(task, entries, max_entries, skip);
+	stack_trace_print(entries, nr_entries, spaces);
+}
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
 void qdf_print_thread_trace(qdf_thread_t *thread)
 {
 	const int spaces = 4;