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

Function sched_note_csection

drivers/note/note_driver.c:1100–1139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1098
1099#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
1100void sched_note_csection(FAR struct tcb_s *tcb, bool enter)
1101{
1102 struct note_csection_s note;
1103 FAR struct note_driver_s **driver;
1104 bool formatted = false;
1105
1106 for (driver = g_note_drivers; *driver; driver++)
1107 {
1108 if (!note_isenabled(*driver))
1109 {
1110 continue;
1111 }
1112
1113 if (note_csection(*driver, tcb, enter))
1114 {
1115 continue;
1116 }
1117
1118 if ((*driver)->ops->add == NULL)
1119 {
1120 continue;
1121 }
1122
1123 /* Format the note */
1124
1125 if (!formatted)
1126 {
1127 formatted = true;
1128 note_common(tcb, &note.ncs_cmn, sizeof(struct note_csection_s),
1129 enter ? NOTE_CSECTION_ENTER : NOTE_CSECTION_LEAVE);
1130#ifdef CONFIG_SMP
1131 note.ncs_count = tcb->irqcount;
1132#endif
1133 }
1134
1135 /* Add the note to circular buffer */
1136
1137 note_add(*driver, &note, sizeof(struct note_csection_s));
1138 }
1139}
1140#endif
1141
1142/****************************************************************************

Callers 2

enter_critical_sectionFunction · 0.85
leave_critical_sectionFunction · 0.85

Calls 2

note_isenabledFunction · 0.85
note_commonFunction · 0.85

Tested by

no test coverage detected