Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_ktrace.c
Show First 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static void | static void | ||||
ktr_enqueuerequest(struct thread *td, struct ktr_request *req) | ktr_enqueuerequest(struct thread *td, struct ktr_request *req) | ||||
{ | { | ||||
mtx_lock(&ktrace_mtx); | mtx_lock(&ktrace_mtx); | ||||
STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list); | STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list); | ||||
mtx_unlock(&ktrace_mtx); | mtx_unlock(&ktrace_mtx); | ||||
thread_lock(td); | |||||
td->td_flags |= TDF_ASTPENDING; | |||||
thread_unlock(td); | |||||
} | } | ||||
/* | /* | ||||
* Drain any pending ktrace records from the per-thread queue to disk. This | * Drain any pending ktrace records from the per-thread queue to disk. This | ||||
* is used both internally before committing other records, and also on | * is used both internally before committing other records, and also on | ||||
* system call return. We drain all the ones we can find at the time when | * system call return. We drain all the ones we can find at the time when | ||||
* drain is requested, but don't keep draining after that as those events | * drain is requested, but don't keep draining after that as those events | ||||
* may be approximately "after" the current event. | * may be approximately "after" the current event. | ||||
▲ Show 20 Lines • Show All 969 Lines • Show Last 20 Lines |