Skip to content

Commit

Permalink
trace: replace all *_wo_note to _notrace to make api define more appr…
Browse files Browse the repository at this point in the history
  • Loading branch information
anchao committed Nov 26, 2024
1 parent 5354850 commit 75e29ad
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 84 deletions.
16 changes: 8 additions & 8 deletions drivers/note/note_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ void sched_note_filter_mode(FAR struct note_filter_named_mode_s *oldm,
irqstate_t irq_mask;
FAR struct note_driver_s **driver;

irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
irq_mask = spin_lock_irqsave_notrace(&g_note_lock);

if (oldm != NULL)
{
Expand Down Expand Up @@ -1873,7 +1873,7 @@ void sched_note_filter_mode(FAR struct note_filter_named_mode_s *oldm,
}
}

spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
spin_unlock_irqrestore_notrace(&g_note_lock, irq_mask);
}

/****************************************************************************
Expand Down Expand Up @@ -1903,7 +1903,7 @@ void sched_note_filter_syscall(FAR struct note_filter_named_syscall_s *oldf,
irqstate_t irq_mask;
FAR struct note_driver_s **driver;

irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
irq_mask = spin_lock_irqsave_notrace(&g_note_lock);

if (oldf != NULL)
{
Expand Down Expand Up @@ -1939,7 +1939,7 @@ void sched_note_filter_syscall(FAR struct note_filter_named_syscall_s *oldf,
}
}

spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
spin_unlock_irqrestore_notrace(&g_note_lock, irq_mask);
}
#endif

Expand Down Expand Up @@ -1970,7 +1970,7 @@ void sched_note_filter_irq(FAR struct note_filter_named_irq_s *oldf,
irqstate_t irq_mask;
FAR struct note_driver_s **driver;

irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
irq_mask = spin_lock_irqsave_notrace(&g_note_lock);

if (oldf != NULL)
{
Expand Down Expand Up @@ -2006,7 +2006,7 @@ void sched_note_filter_irq(FAR struct note_filter_named_irq_s *oldf,
}
}

spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
spin_unlock_irqrestore_notrace(&g_note_lock, irq_mask);
}
#endif

Expand Down Expand Up @@ -2037,7 +2037,7 @@ void sched_note_filter_tag(FAR struct note_filter_named_tag_s *oldf,
irqstate_t falgs;
FAR struct note_driver_s **driver;

falgs = spin_lock_irqsave_wo_note(&g_note_lock);
falgs = spin_lock_irqsave_notrace(&g_note_lock);

if (oldf != NULL)
{
Expand Down Expand Up @@ -2073,7 +2073,7 @@ void sched_note_filter_tag(FAR struct note_filter_named_tag_s *oldf,
}
}

spin_unlock_irqrestore_wo_note(&g_note_lock, falgs);
spin_unlock_irqrestore_notrace(&g_note_lock, falgs);
}
#endif

Expand Down
26 changes: 13 additions & 13 deletions drivers/note/noteram_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ static ssize_t noteram_read(FAR struct file *filep, FAR char *buffer,

if (ctx->mode == NOTERAM_MODE_READ_BINARY)
{
flags = spin_lock_irqsave_wo_note(&drv->lock);
flags = spin_lock_irqsave_notrace(&drv->lock);
ret = noteram_get(drv, (FAR uint8_t *)buffer, buflen);
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
}
else
{
Expand All @@ -481,9 +481,9 @@ static ssize_t noteram_read(FAR struct file *filep, FAR char *buffer,

/* Get the next note (removing it from the buffer) */

flags = spin_lock_irqsave_wo_note(&drv->lock);
flags = spin_lock_irqsave_notrace(&drv->lock);
ret = noteram_get(drv, note, sizeof(note));
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
if (ret <= 0)
{
return ret;
Expand All @@ -508,7 +508,7 @@ static int noteram_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
int ret = -ENOSYS;
FAR struct noteram_driver_s *drv = filep->f_inode->i_private;
irqstate_t flags = spin_lock_irqsave_wo_note(&drv->lock);
irqstate_t flags = spin_lock_irqsave_notrace(&drv->lock);

/* Handle the ioctl commands */

Expand Down Expand Up @@ -600,7 +600,7 @@ static int noteram_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
break;
}

spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
return ret;
}

Expand All @@ -622,7 +622,7 @@ static int noteram_poll(FAR struct file *filep, FAR struct pollfd *fds,
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
drv = inode->i_private;

flags = spin_lock_irqsave_wo_note(&drv->lock);
flags = spin_lock_irqsave_notrace(&drv->lock);

/* Ignore waits that do not include POLLIN */

Expand Down Expand Up @@ -655,7 +655,7 @@ static int noteram_poll(FAR struct file *filep, FAR struct pollfd *fds,

if (noteram_unread_length(drv) > 0)
{
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
poll_notify(&drv->pfd, 1, POLLIN);
return ret;
}
Expand All @@ -666,7 +666,7 @@ static int noteram_poll(FAR struct file *filep, FAR struct pollfd *fds,
}

errout:
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
return ret;
}

Expand Down Expand Up @@ -698,11 +698,11 @@ static void noteram_add(FAR struct note_driver_s *driver,
unsigned int space;
irqstate_t flags;

flags = spin_lock_irqsave_wo_note(&drv->lock);
flags = spin_lock_irqsave_notrace(&drv->lock);

if (drv->ni_overwrite == NOTERAM_MODE_OVERWRITE_OVERFLOW)
{
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
return;
}

Expand All @@ -716,7 +716,7 @@ static void noteram_add(FAR struct note_driver_s *driver,
/* Stop recording if not in overwrite mode */

drv->ni_overwrite = NOTERAM_MODE_OVERWRITE_OVERFLOW;
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
return;
}

Expand All @@ -737,7 +737,7 @@ static void noteram_add(FAR struct note_driver_s *driver,
memcpy(drv->ni_buffer + head, note, space);
memcpy(drv->ni_buffer, buf + space, notelen - space);
drv->ni_head = noteram_next(drv, head, NOTE_ALIGN(notelen));
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
spin_unlock_irqrestore_notrace(&drv->lock, flags);
poll_notify(&drv->pfd, 1, POLLIN);
}

Expand Down
2 changes: 1 addition & 1 deletion include/nuttx/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
do \
{ \
g_cpu_irqset = 0; \
spin_unlock_wo_note(&g_cpu_irqlock); \
spin_unlock_notrace(&g_cpu_irqlock); \
} \
while (0)
#endif
Expand Down
50 changes: 25 additions & 25 deletions include/nuttx/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static inline spinlock_t up_testset(FAR volatile spinlock_t *lock)
#define spin_lock_init(l) do { *(l) = SP_UNLOCKED; } while (0)

/****************************************************************************
* Name: spin_lock_wo_note
* Name: spin_lock_notrace
*
* Description:
* If this CPU does not already hold the spinlock, then loop until the
Expand All @@ -240,7 +240,7 @@ static inline spinlock_t up_testset(FAR volatile spinlock_t *lock)
****************************************************************************/

#ifdef CONFIG_SPINLOCK
static inline_function void spin_lock_wo_note(FAR volatile spinlock_t *lock)
static inline_function void spin_lock_notrace(FAR volatile spinlock_t *lock)
{
#ifdef CONFIG_TICKET_SPINLOCK
unsigned short ticket =
Expand Down Expand Up @@ -290,7 +290,7 @@ static inline_function void spin_lock(FAR volatile spinlock_t *lock)

/* Lock without trace note */

spin_lock_wo_note(lock);
spin_lock_notrace(lock);

/* Notify that we have the spinlock */

Expand All @@ -299,7 +299,7 @@ static inline_function void spin_lock(FAR volatile spinlock_t *lock)
#endif /* CONFIG_SPINLOCK */

/****************************************************************************
* Name: spin_trylock_wo_note
* Name: spin_trylock_notrace
*
* Description:
* Try once to lock the spinlock. Do not wait if the spinlock is already
Expand All @@ -322,7 +322,7 @@ static inline_function void spin_lock(FAR volatile spinlock_t *lock)

#ifdef CONFIG_SPINLOCK
static inline_function bool
spin_trylock_wo_note(FAR volatile spinlock_t *lock)
spin_trylock_notrace(FAR volatile spinlock_t *lock)
{
#ifdef CONFIG_TICKET_SPINLOCK
unsigned short ticket =
Expand Down Expand Up @@ -387,7 +387,7 @@ static inline_function bool spin_trylock(FAR volatile spinlock_t *lock)

/* Try lock without trace note */

locked = spin_trylock_wo_note(lock);
locked = spin_trylock_notrace(lock);
if (locked)
{
/* Notify that we have the spinlock */
Expand All @@ -406,7 +406,7 @@ static inline_function bool spin_trylock(FAR volatile spinlock_t *lock)
#endif /* CONFIG_SPINLOCK */

/****************************************************************************
* Name: spin_unlock_wo_note
* Name: spin_unlock_notrace
*
* Description:
* Release one count on a non-reentrant spinlock.
Expand All @@ -427,7 +427,7 @@ static inline_function bool spin_trylock(FAR volatile spinlock_t *lock)

#ifdef CONFIG_SPINLOCK
static inline_function void
spin_unlock_wo_note(FAR volatile spinlock_t *lock)
spin_unlock_notrace(FAR volatile spinlock_t *lock)
{
SP_DMB();
#ifdef CONFIG_TICKET_SPINLOCK
Expand Down Expand Up @@ -463,7 +463,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock)
{
/* Unlock without trace note */

spin_unlock_wo_note(lock);
spin_unlock_notrace(lock);

/* Notify that we are unlocking the spinlock */

Expand Down Expand Up @@ -496,7 +496,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock)
#endif

/****************************************************************************
* Name: spin_lock_irqsave_wo_note
* Name: spin_lock_irqsave_notrace
*
* Description:
* This function is no trace version of spin_lock_irqsave()
Expand All @@ -505,7 +505,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock)

#ifdef CONFIG_SPINLOCK
static inline_function
irqstate_t spin_lock_irqsave_wo_note(FAR volatile spinlock_t *lock)
irqstate_t spin_lock_irqsave_notrace(FAR volatile spinlock_t *lock)
{
irqstate_t ret;
ret = up_irq_save();
Expand All @@ -515,21 +515,21 @@ irqstate_t spin_lock_irqsave_wo_note(FAR volatile spinlock_t *lock)
int me = this_cpu();
if (0 == g_irq_spin_count[me])
{
spin_lock_wo_note(&g_irq_spin);
spin_lock_notrace(&g_irq_spin);
}

g_irq_spin_count[me]++;
DEBUGASSERT(0 != g_irq_spin_count[me]);
}
else
{
spin_lock_wo_note(lock);
spin_lock_notrace(lock);
}

return ret;
}
#else
# define spin_lock_irqsave_wo_note(l) ((void)(l), up_irq_save())
# define spin_lock_irqsave_notrace(l) ((void)(l), up_irq_save())
#endif

/****************************************************************************
Expand Down Expand Up @@ -577,7 +577,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)

/* Lock without trace note */

flags = spin_lock_irqsave_wo_note(lock);
flags = spin_lock_irqsave_notrace(lock);

/* Notify that we have the spinlock */

Expand All @@ -590,7 +590,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
#endif

/****************************************************************************
* Name: spin_trylock_irqsave_wo_note
* Name: spin_trylock_irqsave_notrace
*
* Description:
* Try once to lock the spinlock. Do not wait if the spinlock is already
Expand All @@ -613,14 +613,14 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
****************************************************************************/

#ifdef CONFIG_SPINLOCK
# define spin_trylock_irqsave_wo_note(l, f) \
# define spin_trylock_irqsave_notrace(l, f) \
({ \
f = up_irq_save(); \
spin_trylock_wo_note(l) ? \
spin_trylock_notrace(l) ? \
true : ({ up_irq_restore(f); false; }); \
})
#else
# define spin_trylock_irqsave_wo_note(l, f) \
# define spin_trylock_irqsave_notrace(l, f) \
({ \
(void)(l); \
f = up_irq_save(); \
Expand Down Expand Up @@ -665,7 +665,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
#endif /* CONFIG_SPINLOCK */

/****************************************************************************
* Name: spin_unlock_irqrestore_wo_note
* Name: spin_unlock_irqrestore_notrace
*
* Description:
* This function is no trace version of spin_unlock_irqrestore()
Expand All @@ -674,7 +674,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)

#ifdef CONFIG_SPINLOCK
static inline_function
void spin_unlock_irqrestore_wo_note(FAR volatile spinlock_t *lock,
void spin_unlock_irqrestore_notrace(FAR volatile spinlock_t *lock,
irqstate_t flags)
{
if (NULL == lock)
Expand All @@ -685,18 +685,18 @@ void spin_unlock_irqrestore_wo_note(FAR volatile spinlock_t *lock,

if (0 == g_irq_spin_count[me])
{
spin_unlock_wo_note(&g_irq_spin);
spin_unlock_notrace(&g_irq_spin);
}
}
else
{
spin_unlock_wo_note(lock);
spin_unlock_notrace(lock);
}

up_irq_restore(flags);
}
#else
# define spin_unlock_irqrestore_wo_note(l, f) ((void)(l), up_irq_restore(f))
# define spin_unlock_irqrestore_notrace(l, f) ((void)(l), up_irq_restore(f))
#endif

/****************************************************************************
Expand Down Expand Up @@ -735,7 +735,7 @@ void spin_unlock_irqrestore(FAR volatile spinlock_t *lock,
{
/* Unlock without trace note */

spin_unlock_irqrestore_wo_note(lock, flags);
spin_unlock_irqrestore_notrace(lock, flags);

/* Notify that we are unlocking the spinlock */

Expand Down
Loading

0 comments on commit 75e29ad

Please sign in to comment.