mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
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:
+3
-2
@@ -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
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ typedef CODE void (*tss_dtor_t)(FAR void *);
|
||||
* thrd_t thrd_current(void);
|
||||
*/
|
||||
|
||||
#define thrd_current() ((thrd_t)gettid())
|
||||
#define thrd_current() ((thrd_t)_SCHED_GETTID())
|
||||
|
||||
/* thrd_sleep: suspends execution of the calling thread for the given
|
||||
* period of time
|
||||
|
||||
Reference in New Issue
Block a user