FreeBSD/sys/kern/kern_ktrace.c
/*
 * Disable tracing for a process and release all associated resources.
 * The caller is responsible for releasing a reference on the returned
 * vnode and credentials.
 */
Disable tracing for a process and release all associated resources.
The caller is responsible for releasing a reference on the returned
vnode and credentials.
Disable tracing for a process and release all associated resources . The caller is responsible for releasing a reference on the returned vnode and credentials .
static void
ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp)
{
	struct ktr_request *req;
	PROC_LOCK_ASSERT(p, MA_OWNED);
	mtx_assert(&ktrace_mtx, MA_OWNED);
	*uc = p->p_tracecred;
	p->p_tracecred = NULL;
	if (vp != NULL)
		*vp = p->p_tracevp;
	p->p_tracevp = NULL;
	p->p_traceflag = 0;
	while ((req = STAILQ_FIRST(&p->p_ktr)) != NULL) {
		STAILQ_REMOVE_HEAD(&p->p_ktr, ktr_list);
		ktr_freerequest_locked(req);
	}
}
static void ktr_freeproc ( struct proc * p , struct ucred * * uc , struct vnode * * vp ) { struct ktr_request * req ; PROC_LOCK_ASSERT ( p , MA_OWNED ) ; mtx_assert ( & ktrace_mtx , MA_OWNED ) ; * uc = p -> p_tracecred ; p -> p_tracecred = NULL ; if ( vp != NULL ) * vp = p -> p_tracevp ; p -> p_tracevp = NULL ; p -> p_traceflag = 0 ; while ( ( req = STAILQ_FIRST ( & p -> p_ktr ) ) != NULL ) { STAILQ_REMOVE_HEAD ( & p -> p_ktr , ktr_list ) ; ktr_freerequest_locked ( req ) ; } }
Disable tracing for a process and release all associated resources.
Disable tracing for a process and release all associated resources .