FreeBSD/sys/kern/kern_proc.c
/*
 * Calculate the kinfo_proc members which contain process-wide
 * informations.
 * Must be called with the target process locked.
 */
Calculate the kinfo_proc members which contain process-wide
informations.
Must be called with the target process locked.
Calculate the kinfo_proc members which contain process - wide informations . Must be called with the target process locked .
static void
fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp)
{
	struct thread *td;
	PROC_LOCK_ASSERT(p, MA_OWNED);
	kp->ki_estcpu = 0;
	kp->ki_pctcpu = 0;
	FOREACH_THREAD_IN_PROC(p, td) {
		thread_lock(td);
		kp->ki_pctcpu += sched_pctcpu(td);
		kp->ki_estcpu += sched_estcpu(td);
		thread_unlock(td);
	}
}
static void fill_kinfo_aggregate ( struct proc * p , struct kinfo_proc * kp ) { struct thread * td ; PROC_LOCK_ASSERT ( p , MA_OWNED ) ; kp -> ki_estcpu = 0 ; kp -> ki_pctcpu = 0 ; FOREACH_THREAD_IN_PROC ( p , td ) { thread_lock ( td ) ; kp -> ki_pctcpu += sched_pctcpu ( td ) ; kp -> ki_estcpu += sched_estcpu ( td ) ; thread_unlock ( td ) ; } }
Calculate the kinfo_proc members which contain process-wide
 informations.
Calculate the kinfo_proc members which contain process - wide informations .