| 1098 | |
| 1099 | #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION |
| 1100 | void 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, ¬e.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, ¬e, sizeof(struct note_csection_s)); |
| 1138 | } |
| 1139 | } |
| 1140 | #endif |
| 1141 | |
| 1142 | /**************************************************************************** |
no test coverage detected