Skip to content

Commit 75e29ad

Browse files
committed
trace: replace all *_wo_note to _notrace to make api define more approachable
Follow the linux naming style: https://github.com/torvalds/linux/blob/master/include/linux/preempt.h#L237-L242 https://github.com/torvalds/linux/blob/master/include/linux/srcu.h#L221 Signed-off-by: chao an <[email protected]>
1 parent 5354850 commit 75e29ad

File tree

6 files changed

+84
-84
lines changed

6 files changed

+84
-84
lines changed

drivers/note/note_driver.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ void sched_note_filter_mode(FAR struct note_filter_named_mode_s *oldm,
18371837
irqstate_t irq_mask;
18381838
FAR struct note_driver_s **driver;
18391839

1840-
irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
1840+
irq_mask = spin_lock_irqsave_notrace(&g_note_lock);
18411841

18421842
if (oldm != NULL)
18431843
{
@@ -1873,7 +1873,7 @@ void sched_note_filter_mode(FAR struct note_filter_named_mode_s *oldm,
18731873
}
18741874
}
18751875

1876-
spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
1876+
spin_unlock_irqrestore_notrace(&g_note_lock, irq_mask);
18771877
}
18781878

18791879
/****************************************************************************
@@ -1903,7 +1903,7 @@ void sched_note_filter_syscall(FAR struct note_filter_named_syscall_s *oldf,
19031903
irqstate_t irq_mask;
19041904
FAR struct note_driver_s **driver;
19051905

1906-
irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
1906+
irq_mask = spin_lock_irqsave_notrace(&g_note_lock);
19071907

19081908
if (oldf != NULL)
19091909
{
@@ -1939,7 +1939,7 @@ void sched_note_filter_syscall(FAR struct note_filter_named_syscall_s *oldf,
19391939
}
19401940
}
19411941

1942-
spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
1942+
spin_unlock_irqrestore_notrace(&g_note_lock, irq_mask);
19431943
}
19441944
#endif
19451945

@@ -1970,7 +1970,7 @@ void sched_note_filter_irq(FAR struct note_filter_named_irq_s *oldf,
19701970
irqstate_t irq_mask;
19711971
FAR struct note_driver_s **driver;
19721972

1973-
irq_mask = spin_lock_irqsave_wo_note(&g_note_lock);
1973+
irq_mask = spin_lock_irqsave_notrace(&g_note_lock);
19741974

19751975
if (oldf != NULL)
19761976
{
@@ -2006,7 +2006,7 @@ void sched_note_filter_irq(FAR struct note_filter_named_irq_s *oldf,
20062006
}
20072007
}
20082008

2009-
spin_unlock_irqrestore_wo_note(&g_note_lock, irq_mask);
2009+
spin_unlock_irqrestore_notrace(&g_note_lock, irq_mask);
20102010
}
20112011
#endif
20122012

@@ -2037,7 +2037,7 @@ void sched_note_filter_tag(FAR struct note_filter_named_tag_s *oldf,
20372037
irqstate_t falgs;
20382038
FAR struct note_driver_s **driver;
20392039

2040-
falgs = spin_lock_irqsave_wo_note(&g_note_lock);
2040+
falgs = spin_lock_irqsave_notrace(&g_note_lock);
20412041

20422042
if (oldf != NULL)
20432043
{
@@ -2073,7 +2073,7 @@ void sched_note_filter_tag(FAR struct note_filter_named_tag_s *oldf,
20732073
}
20742074
}
20752075

2076-
spin_unlock_irqrestore_wo_note(&g_note_lock, falgs);
2076+
spin_unlock_irqrestore_notrace(&g_note_lock, falgs);
20772077
}
20782078
#endif
20792079

drivers/note/noteram_driver.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ static ssize_t noteram_read(FAR struct file *filep, FAR char *buffer,
467467

468468
if (ctx->mode == NOTERAM_MODE_READ_BINARY)
469469
{
470-
flags = spin_lock_irqsave_wo_note(&drv->lock);
470+
flags = spin_lock_irqsave_notrace(&drv->lock);
471471
ret = noteram_get(drv, (FAR uint8_t *)buffer, buflen);
472-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
472+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
473473
}
474474
else
475475
{
@@ -481,9 +481,9 @@ static ssize_t noteram_read(FAR struct file *filep, FAR char *buffer,
481481

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

484-
flags = spin_lock_irqsave_wo_note(&drv->lock);
484+
flags = spin_lock_irqsave_notrace(&drv->lock);
485485
ret = noteram_get(drv, note, sizeof(note));
486-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
486+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
487487
if (ret <= 0)
488488
{
489489
return ret;
@@ -508,7 +508,7 @@ static int noteram_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
508508
{
509509
int ret = -ENOSYS;
510510
FAR struct noteram_driver_s *drv = filep->f_inode->i_private;
511-
irqstate_t flags = spin_lock_irqsave_wo_note(&drv->lock);
511+
irqstate_t flags = spin_lock_irqsave_notrace(&drv->lock);
512512

513513
/* Handle the ioctl commands */
514514

@@ -600,7 +600,7 @@ static int noteram_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
600600
break;
601601
}
602602

603-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
603+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
604604
return ret;
605605
}
606606

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

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

627627
/* Ignore waits that do not include POLLIN */
628628

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

656656
if (noteram_unread_length(drv) > 0)
657657
{
658-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
658+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
659659
poll_notify(&drv->pfd, 1, POLLIN);
660660
return ret;
661661
}
@@ -666,7 +666,7 @@ static int noteram_poll(FAR struct file *filep, FAR struct pollfd *fds,
666666
}
667667

668668
errout:
669-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
669+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
670670
return ret;
671671
}
672672

@@ -698,11 +698,11 @@ static void noteram_add(FAR struct note_driver_s *driver,
698698
unsigned int space;
699699
irqstate_t flags;
700700

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

703703
if (drv->ni_overwrite == NOTERAM_MODE_OVERWRITE_OVERFLOW)
704704
{
705-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
705+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
706706
return;
707707
}
708708

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

718718
drv->ni_overwrite = NOTERAM_MODE_OVERWRITE_OVERFLOW;
719-
spin_unlock_irqrestore_wo_note(&drv->lock, flags);
719+
spin_unlock_irqrestore_notrace(&drv->lock, flags);
720720
return;
721721
}
722722

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

include/nuttx/irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
do \
8181
{ \
8282
g_cpu_irqset = 0; \
83-
spin_unlock_wo_note(&g_cpu_irqlock); \
83+
spin_unlock_notrace(&g_cpu_irqlock); \
8484
} \
8585
while (0)
8686
#endif

include/nuttx/spinlock.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static inline spinlock_t up_testset(FAR volatile spinlock_t *lock)
218218
#define spin_lock_init(l) do { *(l) = SP_UNLOCKED; } while (0)
219219

220220
/****************************************************************************
221-
* Name: spin_lock_wo_note
221+
* Name: spin_lock_notrace
222222
*
223223
* Description:
224224
* If this CPU does not already hold the spinlock, then loop until the
@@ -240,7 +240,7 @@ static inline spinlock_t up_testset(FAR volatile spinlock_t *lock)
240240
****************************************************************************/
241241

242242
#ifdef CONFIG_SPINLOCK
243-
static inline_function void spin_lock_wo_note(FAR volatile spinlock_t *lock)
243+
static inline_function void spin_lock_notrace(FAR volatile spinlock_t *lock)
244244
{
245245
#ifdef CONFIG_TICKET_SPINLOCK
246246
unsigned short ticket =
@@ -290,7 +290,7 @@ static inline_function void spin_lock(FAR volatile spinlock_t *lock)
290290

291291
/* Lock without trace note */
292292

293-
spin_lock_wo_note(lock);
293+
spin_lock_notrace(lock);
294294

295295
/* Notify that we have the spinlock */
296296

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

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

323323
#ifdef CONFIG_SPINLOCK
324324
static inline_function bool
325-
spin_trylock_wo_note(FAR volatile spinlock_t *lock)
325+
spin_trylock_notrace(FAR volatile spinlock_t *lock)
326326
{
327327
#ifdef CONFIG_TICKET_SPINLOCK
328328
unsigned short ticket =
@@ -387,7 +387,7 @@ static inline_function bool spin_trylock(FAR volatile spinlock_t *lock)
387387

388388
/* Try lock without trace note */
389389

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

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

428428
#ifdef CONFIG_SPINLOCK
429429
static inline_function void
430-
spin_unlock_wo_note(FAR volatile spinlock_t *lock)
430+
spin_unlock_notrace(FAR volatile spinlock_t *lock)
431431
{
432432
SP_DMB();
433433
#ifdef CONFIG_TICKET_SPINLOCK
@@ -463,7 +463,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock)
463463
{
464464
/* Unlock without trace note */
465465

466-
spin_unlock_wo_note(lock);
466+
spin_unlock_notrace(lock);
467467

468468
/* Notify that we are unlocking the spinlock */
469469

@@ -496,7 +496,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock)
496496
#endif
497497

498498
/****************************************************************************
499-
* Name: spin_lock_irqsave_wo_note
499+
* Name: spin_lock_irqsave_notrace
500500
*
501501
* Description:
502502
* This function is no trace version of spin_lock_irqsave()
@@ -505,7 +505,7 @@ static inline_function void spin_unlock(FAR volatile spinlock_t *lock)
505505

506506
#ifdef CONFIG_SPINLOCK
507507
static inline_function
508-
irqstate_t spin_lock_irqsave_wo_note(FAR volatile spinlock_t *lock)
508+
irqstate_t spin_lock_irqsave_notrace(FAR volatile spinlock_t *lock)
509509
{
510510
irqstate_t ret;
511511
ret = up_irq_save();
@@ -515,21 +515,21 @@ irqstate_t spin_lock_irqsave_wo_note(FAR volatile spinlock_t *lock)
515515
int me = this_cpu();
516516
if (0 == g_irq_spin_count[me])
517517
{
518-
spin_lock_wo_note(&g_irq_spin);
518+
spin_lock_notrace(&g_irq_spin);
519519
}
520520

521521
g_irq_spin_count[me]++;
522522
DEBUGASSERT(0 != g_irq_spin_count[me]);
523523
}
524524
else
525525
{
526-
spin_lock_wo_note(lock);
526+
spin_lock_notrace(lock);
527527
}
528528

529529
return ret;
530530
}
531531
#else
532-
# define spin_lock_irqsave_wo_note(l) ((void)(l), up_irq_save())
532+
# define spin_lock_irqsave_notrace(l) ((void)(l), up_irq_save())
533533
#endif
534534

535535
/****************************************************************************
@@ -577,7 +577,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
577577

578578
/* Lock without trace note */
579579

580-
flags = spin_lock_irqsave_wo_note(lock);
580+
flags = spin_lock_irqsave_notrace(lock);
581581

582582
/* Notify that we have the spinlock */
583583

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

592592
/****************************************************************************
593-
* Name: spin_trylock_irqsave_wo_note
593+
* Name: spin_trylock_irqsave_notrace
594594
*
595595
* Description:
596596
* Try once to lock the spinlock. Do not wait if the spinlock is already
@@ -613,14 +613,14 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
613613
****************************************************************************/
614614

615615
#ifdef CONFIG_SPINLOCK
616-
# define spin_trylock_irqsave_wo_note(l, f) \
616+
# define spin_trylock_irqsave_notrace(l, f) \
617617
({ \
618618
f = up_irq_save(); \
619-
spin_trylock_wo_note(l) ? \
619+
spin_trylock_notrace(l) ? \
620620
true : ({ up_irq_restore(f); false; }); \
621621
})
622622
#else
623-
# define spin_trylock_irqsave_wo_note(l, f) \
623+
# define spin_trylock_irqsave_notrace(l, f) \
624624
({ \
625625
(void)(l); \
626626
f = up_irq_save(); \
@@ -665,7 +665,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
665665
#endif /* CONFIG_SPINLOCK */
666666

667667
/****************************************************************************
668-
* Name: spin_unlock_irqrestore_wo_note
668+
* Name: spin_unlock_irqrestore_notrace
669669
*
670670
* Description:
671671
* This function is no trace version of spin_unlock_irqrestore()
@@ -674,7 +674,7 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
674674

675675
#ifdef CONFIG_SPINLOCK
676676
static inline_function
677-
void spin_unlock_irqrestore_wo_note(FAR volatile spinlock_t *lock,
677+
void spin_unlock_irqrestore_notrace(FAR volatile spinlock_t *lock,
678678
irqstate_t flags)
679679
{
680680
if (NULL == lock)
@@ -685,18 +685,18 @@ void spin_unlock_irqrestore_wo_note(FAR volatile spinlock_t *lock,
685685

686686
if (0 == g_irq_spin_count[me])
687687
{
688-
spin_unlock_wo_note(&g_irq_spin);
688+
spin_unlock_notrace(&g_irq_spin);
689689
}
690690
}
691691
else
692692
{
693-
spin_unlock_wo_note(lock);
693+
spin_unlock_notrace(lock);
694694
}
695695

696696
up_irq_restore(flags);
697697
}
698698
#else
699-
# define spin_unlock_irqrestore_wo_note(l, f) ((void)(l), up_irq_restore(f))
699+
# define spin_unlock_irqrestore_notrace(l, f) ((void)(l), up_irq_restore(f))
700700
#endif
701701

702702
/****************************************************************************
@@ -735,7 +735,7 @@ void spin_unlock_irqrestore(FAR volatile spinlock_t *lock,
735735
{
736736
/* Unlock without trace note */
737737

738-
spin_unlock_irqrestore_wo_note(lock, flags);
738+
spin_unlock_irqrestore_notrace(lock, flags);
739739

740740
/* Notify that we are unlocking the spinlock */
741741

0 commit comments

Comments
 (0)