MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sleepq_profile

Function sleepq_profile

freebsd/kern/subr_sleepqueue.c:1295–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1293MTX_SYSINIT(sleepq_prof_lock, &sleepq_prof_lock, "sleepq_prof", MTX_SPIN);
1294
1295static void
1296sleepq_profile(const char *wmesg)
1297{
1298 struct sleepq_prof *sp;
1299
1300 mtx_lock_spin(&sleepq_prof_lock);
1301 if (prof_enabled == 0)
1302 goto unlock;
1303 LIST_FOREACH(sp, &sleepq_hash[SC_HASH(wmesg)], sp_link)
1304 if (sp->sp_wmesg == wmesg)
1305 goto done;
1306 sp = LIST_FIRST(&sleepq_prof_free);
1307 if (sp == NULL)
1308 goto unlock;
1309 sp->sp_wmesg = wmesg;
1310 LIST_REMOVE(sp, sp_link);
1311 LIST_INSERT_HEAD(&sleepq_hash[SC_HASH(wmesg)], sp, sp_link);
1312done:
1313 sp->sp_count++;
1314unlock:
1315 mtx_unlock_spin(&sleepq_prof_lock);
1316 return;
1317}
1318
1319static void
1320sleepq_prof_reset(void)

Callers 1

sleepq_switchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected