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

Function sched_note_spinlock

drivers/note/note_driver.c:1158–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1156
1157#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS
1158void 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, &note.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, &note, sizeof(struct note_spinlock_s));
1197 }
1198}
1199
1200void sched_note_spinlock_lock(FAR volatile spinlock_t *spinlock)
1201{

Callers 4

sched_note_spinlock_lockFunction · 0.85

Calls 3

note_isenabledFunction · 0.85
note_spinlockFunction · 0.85
note_commonFunction · 0.85

Tested by

no test coverage detected