--- zzzz-none-000/linux-5.15.111/lib/dump_stack.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/lib/dump_stack.c 2024-02-07 10:23:29.000000000 +0000 @@ -52,10 +52,13 @@ * Arch-specific dump_stack() implementations can use this function to * print out the same debug information as the generic dump_stack(). */ -void dump_stack_print_info(const char *log_lvl) +void dump_stack_print_info(const char *log_lvl, struct task_struct *task) { + if (!task) + task = current; + printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s" BUILD_ID_FMT "\n", - log_lvl, raw_smp_processor_id(), current->pid, current->comm, + log_lvl, task_cpu(task), task->pid, task->comm, kexec_crash_loaded() ? "Kdump: loaded " : "", print_tainted(), init_utsname()->release, @@ -66,8 +69,8 @@ printk("%sHardware name: %s\n", log_lvl, dump_stack_arch_desc_str); - print_worker_info(log_lvl, current); - print_stop_info(log_lvl, current); + print_worker_info(log_lvl, task); + print_stop_info(log_lvl, task); } /** @@ -77,14 +80,17 @@ * show_regs() implementations can use this function to print out generic * debug information. */ -void show_regs_print_info(const char *log_lvl) +void show_regs_print_info(const char *log_lvl, struct task_struct *task) { - dump_stack_print_info(log_lvl); + if (!task) + task = current; + + dump_stack_print_info(log_lvl, task); } static void __dump_stack(const char *log_lvl) { - dump_stack_print_info(log_lvl); + dump_stack_print_info(log_lvl, NULL); show_stack(NULL, NULL, log_lvl); }