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 -3
View File
@@ -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