sched_note: Fix spinlock instrumentation

This commit is contained in:
Masayuki Ishikawa 2017-01-12 08:03:36 -06:00 committed by Gregory Nutt
parent 4ca27e06a7
commit acbfa47f70
2 changed files with 14 additions and 8 deletions

View File

@ -732,7 +732,7 @@ config SCHED_INSTRUMENTATION_CSECTION
void sched_note_csection(FAR struct tcb_s *tcb, bool state);
config SCHED_INSTRUMENTATION_SPINLOCK
config SCHED_INSTRUMENTATION_SPINLOCKS
bool "Spinlock monitor hooks"
default n
---help---

View File

@ -82,6 +82,12 @@ struct note_startalloc_s
# define SIZEOF_NOTE_START(n) (sizeof(struct note_start_s))
#endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static void note_add(FAR const uint8_t *note, uint8_t notelen);
/****************************************************************************
* Private Data
****************************************************************************/
@ -558,21 +564,21 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter)
#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS
void sched_note_spinlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock)
{
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_LOCK)
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_LOCK);
}
void sched_note_spinlocked(FAR struct tcb_s *tcb, FAR volatile void *spinlock);
void sched_note_spinlocked(FAR struct tcb_s *tcb, FAR volatile void *spinlock)
{
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_LOCKED)
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_LOCKED);
}
void sched_note_spinunlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock);
void sched_note_spinunlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock)
{
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_UNLOCK)
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_UNLOCK);
}
void sched_note_spinabort(FAR struct tcb_s *tcb, FAR volatile void *spinlock);
void sched_note_spinabort(FAR struct tcb_s *tcb, FAR volatile void *spinlock)
{
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_ABORT)
note_spincommon(tcb, spinlock, NOTE_SPINLOCK_ABORT);
}
#endif