sched/note: add wdog note for segger sysview

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-07-09 18:05:53 +08:00 committed by Xiang Xiao
parent 46b1c8605a
commit f3d6119282

View File

@ -79,6 +79,10 @@ static void note_sysview_heap(FAR struct note_driver_s *drv,
uint8_t event, FAR void *heap, FAR void *mem,
size_t size, size_t curused);
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_WDOG
static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
FAR void *handler, FAR const void *arg);
#endif
/****************************************************************************
* Private Data
@ -120,7 +124,7 @@ static const struct note_driver_ops_s g_note_sysview_ops =
note_sysview_irqhandler, /* irqhandler */
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_WDOG
NULL, /* wdog */
note_sysview_wdog, /* wdog */
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_HEAP
note_sysview_heap, /* heap */
@ -389,6 +393,21 @@ static void note_sysview_heap(FAR struct note_driver_s *drv,
}
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_WDOG
static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
FAR void *handler, FAR const void *arg)
{
if (event == NOTE_WDOG_ENTER)
{
SEGGER_SYSVIEW_RecordEnterTimer((uintptr_t)handler);
}
else if (event == NOTE_WDOG_LEAVE)
{
SEGGER_SYSVIEW_RecordExitTimer();
}
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/