mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +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:
@@ -583,7 +583,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd,
|
||||
/* Save the notification events */
|
||||
|
||||
dev->md_notify_event = macarg->event;
|
||||
dev->md_notify_pid = getpid();
|
||||
dev->md_notify_pid = nxsched_getpid();
|
||||
dev->md_notify_registered = true;
|
||||
|
||||
ret = OK;
|
||||
|
||||
@@ -939,7 +939,7 @@ static int macnet_ioctl(FAR struct net_driver_s *dev, int cmd,
|
||||
/* Save the notification events */
|
||||
|
||||
priv->md_notify_event = netmac->u.event;
|
||||
priv->md_notify_pid = getpid();
|
||||
priv->md_notify_pid = nxsched_getpid();
|
||||
priv->md_notify_registered = true;
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user