Commit Graph

12 Commits

Author SHA1 Message Date
Bowen Wang c9e3a0669f sched_backtrace: define sched_dumpstack when not enable SCHED_BACKTRACE
Before directly use sched_backtrace() with SCHED_BACKTRACE disable will
lead compile error, this commit avoid this problem by define
sched_backtrace to 0 when CONFIG_SCHED_BACKTRACE not enable.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 05:46:37 -07:00
Xiang Xiao 7990f90915 Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 09:52:08 -03:00
wangbowen6 7a4bd09e48 execinfo.h: include nuttx/sched.h instead sched.h
beacause _SCHED_GETTID is in nuttx/sched.h, when use dump_stack()
compile error log:
unqlite.c:51256: undefined reference to `_SCHED_GETTID'

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-23 14:24:32 +08:00
chao an 4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Xiang Xiao dd942f0b04 sched/backtrace: Dump the complete stack regardless the depth
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 12:09:54 +08:00
Xiang Xiao 20bbdd0997 libc: Add backtrace_symbols[_fd] functions
specified here:
https://linux.die.net/man/3/backtrace_symbols

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 12:09:37 +08:00
chao.an 1060953567 sched/backtrace: add sched_backtrace support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 01:30:50 -07:00
chao.an 83964231a5 libs/libc: move the backtrace implement to sched
1. move the backtrace implement to sched
2. rename CONFIG_UNWINDER to CONFIG_SCHED_BACKTRACE

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-19 01:30:50 -07:00
Xiang Xiao 4ba1bafe55 libc/debug: Rename CONFIG_EABI_UNWINDER to CONFIG_UNWINDER
since the unwinder not only work with arm but also other arch(e.g. riscv)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I56cc54f2c99560c858362ab2dfba524097385716
2021-06-30 05:08:57 -07:00
chao.an d5753125db execinfo: include-able from C++ files
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-04-19 04:45:04 -07:00
chao.an 137eb594cb libc/execinfo: add dump_stack support
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-04-19 04:45:04 -07:00
chao.an 27dd771336 libc/execinfo: add backtrace support based on EABI Unwinder
1. Flags < -funwind-tables > is required
2. Keep the section ".exidx" in linker script

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-04-19 04:45:04 -07:00