| 1156 | |
| 1157 | #ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS |
| 1158 | void sched_note_spinlock(FAR struct tcb_s *tcb, |
| 1159 | FAR volatile spinlock_t *spinlock, |
| 1160 | int type) |
| 1161 | { |
| 1162 | struct note_spinlock_s note; |
| 1163 | FAR struct note_driver_s **driver; |
| 1164 | bool formatted = false; |
| 1165 | |
| 1166 | for (driver = g_note_drivers; *driver; driver++) |
| 1167 | { |
| 1168 | if (!note_isenabled(*driver)) |
| 1169 | { |
| 1170 | continue; |
| 1171 | } |
| 1172 | |
| 1173 | if (note_spinlock(*driver, tcb, spinlock, type)) |
| 1174 | { |
| 1175 | continue; |
| 1176 | } |
| 1177 | |
| 1178 | if ((*driver)->ops->add == NULL) |
| 1179 | { |
| 1180 | continue; |
| 1181 | } |
| 1182 | |
| 1183 | /* Format the note */ |
| 1184 | |
| 1185 | if (!formatted) |
| 1186 | { |
| 1187 | formatted = true; |
| 1188 | note_common(tcb, ¬e.nsp_cmn, sizeof(struct note_spinlock_s), |
| 1189 | type); |
| 1190 | note.nsp_spinlock = (uintptr_t)spinlock; |
| 1191 | note.nsp_value = *(FAR uint8_t *)spinlock; |
| 1192 | } |
| 1193 | |
| 1194 | /* Add the note to circular buffer */ |
| 1195 | |
| 1196 | note_add(*driver, ¬e, sizeof(struct note_spinlock_s)); |
| 1197 | } |
| 1198 | } |
| 1199 | |
| 1200 | void sched_note_spinlock_lock(FAR volatile spinlock_t *spinlock) |
| 1201 | { |
no test coverage detected