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>
This commit is contained in:
chao an
2023-02-01 18:05:58 +08:00
committed by Xiang Xiao
parent c24dc389e4
commit 4c8d244fae
57 changed files with 111 additions and 93 deletions
+3 -2
View File
@@ -38,8 +38,9 @@
* ARRAY and return the exact number of values stored.
*/
# define backtrace(buffer, size) sched_backtrace(gettid(), buffer, size, 0)
# define dump_stack() sched_dumpstack(gettid())
# define backtrace(buffer, size) sched_backtrace(_SCHED_GETTID(), \
buffer, size, 0)
# define dump_stack() sched_dumpstack(_SCHED_GETTID())
#else
# define backtrace(buffer, size) 0