Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_turnstile.c
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
static int turnstile_init(void *mem, int size, int flags); | static int turnstile_init(void *mem, int size, int flags); | ||||
static void turnstile_fini(void *mem, int size); | static void turnstile_fini(void *mem, int size); | ||||
SDT_PROVIDER_DECLARE(sched); | SDT_PROVIDER_DECLARE(sched); | ||||
SDT_PROBE_DEFINE(sched, , , sleep); | SDT_PROBE_DEFINE(sched, , , sleep); | ||||
SDT_PROBE_DEFINE2(sched, , , wakeup, "struct thread *", | SDT_PROBE_DEFINE2(sched, , , wakeup, "struct thread *", | ||||
"struct proc *"); | "struct proc *"); | ||||
SDT_PROBE_DEFINE2(sched, , turnstile, ksleep, "struct thread *", | |||||
"const char *"); | |||||
SDT_PROBE_DEFINE2(sched, , turnstile, kwakeup, "struct thread *", | |||||
"const char *"); | |||||
static inline void | static inline void | ||||
propagate_unlock_ts(struct turnstile *top, struct turnstile *ts) | propagate_unlock_ts(struct turnstile *top, struct turnstile *ts) | ||||
{ | { | ||||
if (ts != top) | if (ts != top) | ||||
mtx_unlock_spin(&ts->ts_lock); | mtx_unlock_spin(&ts->ts_lock); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | #endif | ||||
TD_SET_LOCK(td); | TD_SET_LOCK(td); | ||||
mtx_unlock_spin(&tc->tc_lock); | mtx_unlock_spin(&tc->tc_lock); | ||||
propagate_priority(td); | propagate_priority(td); | ||||
if (LOCK_LOG_TEST(lock, 0)) | if (LOCK_LOG_TEST(lock, 0)) | ||||
CTR4(KTR_LOCK, "%s: td %d blocked on [%p] %s", __func__, | CTR4(KTR_LOCK, "%s: td %d blocked on [%p] %s", __func__, | ||||
td->td_tid, lock, lock->lo_name); | td->td_tid, lock, lock->lo_name); | ||||
SDT_PROBE0(sched, , , sleep); | |||||
THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); | THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); | ||||
if (!SDT_PROBES_ENABLED()) { | |||||
mi_switch(SW_VOL | SWT_TURNSTILE); | mi_switch(SW_VOL | SWT_TURNSTILE); | ||||
} else { | |||||
SDT_PROBE0(sched, , , sleep); | |||||
SDT_PROBE2(sched, , turnstile, ksleep, td, | |||||
td->td_lockname); | |||||
mi_switch(SW_VOL | SWT_TURNSTILE); | |||||
SDT_PROBE2(sched, , turnstile, kwakeup, td, | |||||
td->td_lockname); | |||||
} | |||||
if (LOCK_LOG_TEST(lock, 0)) | if (LOCK_LOG_TEST(lock, 0)) | ||||
CTR4(KTR_LOCK, "%s: td %d free from blocked on [%p] %s", | CTR4(KTR_LOCK, "%s: td %d free from blocked on [%p] %s", | ||||
__func__, td->td_tid, lock, lock->lo_name); | __func__, td->td_tid, lock, lock->lo_name); | ||||
} | } | ||||
/* | /* | ||||
* Pick the highest priority thread on this turnstile and put it on the | * Pick the highest priority thread on this turnstile and put it on the | ||||
▲ Show 20 Lines • Show All 504 Lines • Show Last 20 Lines |