This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 9fe58d9004e9786c260c96d5c738d4c17da1e913 Author: yezhonghui <[email protected]> AuthorDate: Wed Mar 4 12:13:07 2026 +0800 spinlock: add noinstrument_function to _notrace functions Add noinstrument_function attribute to all spinlock _notrace functions to prevent them from being instrumented when CONFIG_ARCH_INSTRUMENT_ALL is enabled. These functions are used in the instrument callback path and must not trigger instrumentation to avoid infinite recursion. Pick-adapted: three of the five call sites already carried the attribute in this tree (from the merged spinlock debug series), so only the missing spin_trylock_notrace() and spin_lock_irqsave_notrace() attributes are applied here. Assisted-By: mimo-v2.6-pro Signed-off-by: yezhonghui <[email protected]> --- include/nuttx/spinlock.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h index 475ca3bf5b3..b6c34b41d0b 100644 --- a/include/nuttx/spinlock.h +++ b/include/nuttx/spinlock.h @@ -275,7 +275,7 @@ static inline_function void spin_lock(FAR volatile spinlock_t *lock) ****************************************************************************/ #ifdef CONFIG_SPINLOCK -static inline_function bool +static inline_function noinstrument_function bool spin_trylock_notrace(FAR volatile spinlock_t *lock) { #ifdef CONFIG_TICKET_SPINLOCK @@ -374,7 +374,7 @@ static inline_function bool spin_trylock(FAR volatile spinlock_t *lock) ****************************************************************************/ #ifdef CONFIG_SPINLOCK -static inline_function void +static inline_function noinstrument_function void spin_unlock_notrace(FAR volatile spinlock_t *lock) { #ifdef CONFIG_TICKET_SPINLOCK @@ -455,7 +455,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock) ****************************************************************************/ #ifdef CONFIG_SPINLOCK -static inline_function +static inline_function noinstrument_function irqstate_t spin_lock_irqsave_notrace(FAR volatile spinlock_t *lock) { irqstate_t flags; @@ -1000,7 +1000,7 @@ bool rspin_trylock(FAR rspinlock_t *lock); ****************************************************************************/ #ifdef CONFIG_SPINLOCK -static inline_function +static inline_function noinstrument_function void spin_unlock_irqrestore_notrace(FAR volatile spinlock_t *lock, irqstate_t flags) {
