mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +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:
@@ -1484,7 +1484,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath,
|
||||
|
||||
if (strncmp(relpath, "self", 4) == 0)
|
||||
{
|
||||
tmp = gettid(); /* Get the TID of the calling task */
|
||||
tmp = nxsched_gettid(); /* Get the TID of the calling task */
|
||||
ptr = (FAR char *)relpath + 4; /* Discard const */
|
||||
}
|
||||
else
|
||||
@@ -1792,7 +1792,7 @@ static int proc_opendir(FAR const char *relpath,
|
||||
|
||||
if (strncmp(relpath, "self", 4) == 0)
|
||||
{
|
||||
tmp = gettid(); /* Get the TID of the calling task */
|
||||
tmp = nxsched_gettid(); /* Get the TID of the calling task */
|
||||
ptr = (FAR char *)relpath + 4; /* Discard const */
|
||||
}
|
||||
else
|
||||
@@ -2032,7 +2032,7 @@ static int proc_stat(const char *relpath, struct stat *buf)
|
||||
|
||||
if (strncmp(relpath, "self", 4) == 0)
|
||||
{
|
||||
tmp = gettid(); /* Get the TID of the calling task */
|
||||
tmp = nxsched_gettid(); /* Get the TID of the calling task */
|
||||
ptr = (FAR char *)relpath + 4; /* Discard const */
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user