diff options
author | Qing Zhang <zhangqing@loongson.cn> | 2022-08-06 11:10:04 +0300 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-08-12 08:10:11 +0300 |
commit | 93a4fa622eb061f75f87f0cf9609ab4e69c67d01 (patch) | |
tree | d49f5b01e8a2299424b31d9344101dc5b5a561d7 /arch/loongarch/kernel/switch.S | |
parent | 49aef111e2dae176a7708b532118f33f24289248 (diff) | |
download | linux-93a4fa622eb061f75f87f0cf9609ab4e69c67d01.tar.xz |
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>
Diffstat (limited to 'arch/loongarch/kernel/switch.S')
-rw-r--r-- | arch/loongarch/kernel/switch.S | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/loongarch/kernel/switch.S b/arch/loongarch/kernel/switch.S index 37e84ac8ffc2..43ebbc3990f7 100644 --- a/arch/loongarch/kernel/switch.S +++ b/arch/loongarch/kernel/switch.S @@ -21,6 +21,8 @@ SYM_FUNC_START(__switch_to) cpu_save_nonscratch a0 stptr.d ra, a0, THREAD_REG01 + stptr.d a3, a0, THREAD_SCHED_RA + stptr.d a4, a0, THREAD_SCHED_CFA move tp, a2 cpu_restore_nonscratch a1 |