apache / apache/nuttx

syscall: syscall_wraps apply to kernel side symbols as well

Open
#12,293 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

System call wraps are used to support system call instrumentation (sched note). This feature is done by the linker, using the --wrap option for each symbol respectively, after the nuttx build is otherwise completed. This is a great feature for monitoring system calls from user space, but unfortunately it applies the same wrapping for kernel side symbols as well, so long as the symbol has the same name as the user side system call does.

One example is the `nxsem_xxx` APIs. In fact, any API that has the nx- prefix does this.

I'm sure applying the instrumentation for kernel side APIs is not intentional, and very likely I have contributed to this problem in: https://github.com/apache/nuttx/pull/11257 where sem_xxx APis were moved to user space.

I'm not sure what to do about this, in my opinion moving the user space related parts of POSIX semaphores (cancel points, errno) into libc was the right call, and I had a plan to continue this with pthreads etc (no time to continue this work for now).

This ticket is basically a placeholder for this issue, as well as an open forum for suggestions on how to fix it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.