cnss: Dump stack by stack_trace_print

The kernel API - show_stack isn't used after kernel updated, this
function uses stack_trace_print to dump stack.

Change-Id: Ib793946b3b66b271e05794bea3610ffb3684c44e
Signed-off-by: Wu Gao <quic_wugao@quicinc.com>
This commit is contained in:
Wu Gao 2025-06-23 03:02:26 -07:00
commit 83ec139d77

View file

@ -242,13 +242,21 @@ int cnss_set_cpus_allowed_ptr(struct task_struct *task, ulong cpu)
}
EXPORT_SYMBOL(cnss_set_cpus_allowed_ptr);
/* wlan prop driver cannot invoke show_stack
* function directly, so to invoke this function it
* call wcnss_dump_stack function
*/
#define ENTRIES_COUNT 32
void cnss_dump_stack(struct task_struct *task)
{
show_stack(task, NULL);
const int cnss_spaces = 4;
unsigned long cnss_entries[ENTRIES_COUNT] = {0};
struct stack_trace cnss_trace = {
.nr_entries = 0,
.skip = 0,
.entries = &cnss_entries[0],
.max_entries = ENTRIES_COUNT,
};
save_stack_trace_tsk(task, &cnss_trace);
stack_trace_print(cnss_entries, cnss_trace.nr_entries,
cnss_spaces);
}
EXPORT_SYMBOL(cnss_dump_stack);