All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] LoongArch: Add unwinder support
@ 2022-08-01 12:17 Qing Zhang
  2022-08-01 12:17 ` [PATCH 1/4] LoongArch: Add guess " Qing Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Qing Zhang @ 2022-08-01 12:17 UTC (permalink / raw)
  To: Huacai Chen
  Cc: WANG Xuerui, loongarch, linux-kernel, Jiaxun Yang, hejinyang, zhangqing

This series in order to add stacktrace suport, Some upcoming features require
these changes, like trace, divide unwinder into guess unwinder and prologue
unwinder is to add new unwinders in the future, eg:unwind_frame, unwind_orc .etc.
Three stages when we do unwind,
  1) unwind_start(), the prapare of unwinding, fill unwind_state.
  2) unwind_done(), judge whether the unwind process is finished or not.
  3) unwind_next_frame(), unwind the next frame.

you can test them by:
  1) echo t > /proc/sysrq-trigger
  2) cat /proc/*/stack
  4) ftrace: function graph
  5) uprobe: echo 1 > ./options/userstacktrace

Changes from v1 to v2:

- Add the judgment of the offset value of ra in the prologue.
  (Suggested by Youling).
- Create an inline function to check the sign bit, which is convenient
  for extending other types of immediates.  (Suggested by Jinyang).
- Fix sparse warning :
    arch/loongarch/include/asm/uaccess.h:232:32: sparse: sparse: incorrect
    type in argument 2 (different address spaces) @@     expected void const
    *from @@     got void const [noderef] __user *from @@
- Add USER_STACKTRACE support as a series.

Qing Zhang (4):
  LoongArch: Add guess unwinder support
  LoongArch: Add prologue unwinder support
  LoongArch: Add stacktrace support
  LoongArch: Add USER_STACKTRACE support

 arch/loongarch/Kconfig                  |   6 +
 arch/loongarch/Kconfig.debug            |  28 ++++
 arch/loongarch/include/asm/inst.h       |  52 +++++++
 arch/loongarch/include/asm/processor.h  |   9 ++
 arch/loongarch/include/asm/stacktrace.h |  22 +++
 arch/loongarch/include/asm/switch_to.h  |  14 +-
 arch/loongarch/include/asm/uaccess.h    |   4 +-
 arch/loongarch/include/asm/unwind.h     |  45 +++++++
 arch/loongarch/kernel/Makefile          |   4 +
 arch/loongarch/kernel/asm-offsets.c     |   2 +
 arch/loongarch/kernel/process.c         |  64 +++++++++
 arch/loongarch/kernel/stacktrace.c      |  79 +++++++++++
 arch/loongarch/kernel/switch.S          |   2 +
 arch/loongarch/kernel/traps.c           |  27 ++--
 arch/loongarch/kernel/unwind_guess.c    |  65 +++++++++
 arch/loongarch/kernel/unwind_prologue.c | 172 ++++++++++++++++++++++++
 16 files changed, 577 insertions(+), 18 deletions(-)
 create mode 100644 arch/loongarch/include/asm/unwind.h
 create mode 100644 arch/loongarch/kernel/stacktrace.c
 create mode 100644 arch/loongarch/kernel/unwind_guess.c
 create mode 100644 arch/loongarch/kernel/unwind_prologue.c

-- 
2.20.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-08-14  5:31 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 12:17 [PATCH 0/4] LoongArch: Add unwinder support Qing Zhang
2022-08-01 12:17 ` [PATCH 1/4] LoongArch: Add guess " Qing Zhang
2022-08-01 15:28   ` Huacai Chen
2022-08-01 12:17 ` [PATCH 2/4] LoongArch: Add prologue " Qing Zhang
2022-08-01 15:26   ` Huacai Chen
2022-08-02  1:30     ` Youling Tang
2022-08-02  1:34       ` Huacai Chen
2022-08-02  1:39         ` Xi Ruoyao
2022-08-02  1:53           ` Huacai Chen
2022-08-01 12:17 ` [PATCH 3/4] LoongArch: Add stacktrace support Qing Zhang
2022-08-01 15:30   ` Huacai Chen
2022-08-02  1:19     ` zhangqing
2022-08-02  1:30       ` Huacai Chen
2022-08-02  2:01         ` Qing Zhang
2022-08-13 22:29   ` kernel test robot
2022-08-14  5:31   ` kernel test robot
2022-08-01 12:17 ` [PATCH 4/4] LoongArch: Add USER_STACKTRACE support Qing Zhang
2022-08-01 15:31   ` Huacai Chen
2022-08-01 15:34 ` [PATCH 0/4] LoongArch: Add unwinder support Huacai Chen
2022-08-02  1:15   ` Xi Ruoyao
2022-08-02  1:35   ` zhangqing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.