OSDN Git Service

LoongArch: Add STACKTRACE support
authorQing Zhang <zhangqing@loongson.cn>
Sat, 6 Aug 2022 08:10:04 +0000 (16:10 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 12 Aug 2022 05:10:11 +0000 (13:10 +0800)
commit93a4fa622eb061f75f87f0cf9609ab4e69c67d01
treed49f5b01e8a2299424b31d9344101dc5b5a561d7
parent49aef111e2dae176a7708b532118f33f24289248
LoongArch: Add STACKTRACE support

1. Use common arch_stack_walk() infrastructure to avoid duplicated code
   and avoid taking care of the stack storage and filtering.
2. Add sched_ra (means sched return address) and sched_cfa (means sched
   call frame address) to thread_info, and store them in switch_to().
3. Add __get_wchan() implementation.

Now we can print the process stack and wait channel by cat /proc/*/stack
and /proc/*/wchan.

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/include/asm/processor.h
arch/loongarch/include/asm/switch_to.h
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/asm-offsets.c
arch/loongarch/kernel/process.c
arch/loongarch/kernel/stacktrace.c [new file with mode: 0644]
arch/loongarch/kernel/switch.S