File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -564,6 +564,57 @@ static void note_record_taskname(pid_t pid, FAR const char *name)
564
564
* Public Functions
565
565
****************************************************************************/
566
566
567
+ #ifdef CONFIG_SCHED_INSTRUMENTATION
568
+
569
+ /****************************************************************************
570
+ * Name: sched_note_add
571
+ *
572
+ * Description:
573
+ * Forward rpmsg note data to individual channels.This process does
574
+ * not require filtering
575
+ *
576
+ * Input Parameters:
577
+ * data - The forward note data.
578
+ * len - The len of forward note data.
579
+ *
580
+ * Returned Value:
581
+ * None
582
+ *
583
+ * Assumptions:
584
+ * We are within a critical section.
585
+ *
586
+ ****************************************************************************/
587
+
588
+ void sched_note_add (FAR const void * data , size_t len )
589
+ {
590
+ DEBUGASSERT (data );
591
+
592
+ while (len >= sizeof (struct note_common_s ))
593
+ {
594
+ FAR struct note_common_s * note = (FAR struct note_common_s * )data ;
595
+ size_t notelen = note -> nc_length ;
596
+ FAR struct note_driver_s * * driver ;
597
+
598
+ DEBUGASSERT (notelen >= sizeof (struct note_common_s ) &&
599
+ len >= notelen );
600
+ for (driver = g_note_drivers ; * driver ; driver ++ )
601
+ {
602
+ if ((* driver )-> ops -> add == NULL )
603
+ {
604
+ continue ;
605
+ }
606
+
607
+ /* Add the note to circular buffer */
608
+
609
+ note_add (* driver , note , notelen );
610
+ }
611
+
612
+ data += notelen ;
613
+ len -= notelen ;
614
+ }
615
+ }
616
+ #endif
617
+
567
618
/****************************************************************************
568
619
* Name: sched_note_*
569
620
*
Original file line number Diff line number Diff line change @@ -595,6 +595,12 @@ extern "C"
595
595
*
596
596
****************************************************************************/
597
597
598
+ #ifdef CONFIG_SCHED_INSTRUMENTATION
599
+ void sched_note_add (FAR const void * note , size_t notelen );
600
+ #else
601
+ # define sched_note_add (n ,l )
602
+ #endif
603
+
598
604
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
599
605
void sched_note_start (FAR struct tcb_s * tcb );
600
606
void sched_note_stop (FAR struct tcb_s * tcb );
You can’t perform that action at this time.
0 commit comments