MCPcopy Create free account
hub / github.com/apache/nuttx / sched_note_start

Function sched_note_start

drivers/note/note_driver.c:640–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638 ****************************************************************************/
639
640void sched_note_start(FAR struct tcb_s *tcb)
641{
642 struct note_startalloc_s note;
643 unsigned int length;
644 FAR struct note_driver_s **driver;
645 bool formatted = false;
646
647#if CONFIG_TASK_NAME_SIZE > 0
648 int namelen = 0;
649#endif
650
651 for (driver = g_note_drivers; *driver; driver++)
652 {
653 if (!note_isenabled(*driver))
654 {
655 continue;
656 }
657
658 if (note_start(*driver, tcb))
659 {
660 continue;
661 }
662
663 if ((*driver)->ops->add == NULL)
664 {
665 continue;
666 }
667
668 if (!formatted)
669 {
670 formatted = true;
671
672 /* Copy the task name (if possible) and
673 * get the length of the note
674 */
675
676#if CONFIG_TASK_NAME_SIZE > 0
677 if (tcb->name[0] != '\0')
678 {
679 namelen = strlen(tcb->name);
680 }
681
682 DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
683 strlcpy(note.nsa_name, tcb->name, sizeof(note.nsa_name));
684
685 length = SIZEOF_NOTE_START(namelen + 1);
686#else
687 length = SIZEOF_NOTE_START(0);
688#endif
689
690 /* Finish formatting the note */
691
692 note_common(tcb, &note.nsa_cmn, length, NOTE_START);
693 }
694
695 /* Add the note to circular buffer */
696
697 note_add(*driver, &note, length);

Callers 4

host_cpu_startedFunction · 0.85
nx_startFunction · 0.85
nx_idle_trampolineFunction · 0.85
nxtask_activateFunction · 0.85

Calls 4

note_isenabledFunction · 0.85
note_commonFunction · 0.85
strlenFunction · 0.50
strlcpyFunction · 0.50

Tested by

no test coverage detected