From acbfa47f70ac2ffb679f54996843d9334920262f Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Thu, 12 Jan 2017 08:03:36 -0600 Subject: [PATCH] sched_note: Fix spinlock instrumentation --- sched/Kconfig | 2 +- sched/sched/sched_note.c | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sched/Kconfig b/sched/Kconfig index ecfe78addd..7b8dbaaa76 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -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--- diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index cf7b475c61..bdc308fa91 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -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