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

Function fill_kinfo_aggregate

freebsd/kern/kern_proc.c:1024–1039  ·  view source on GitHub ↗

* Calculate the kinfo_proc members which contain process-wide * informations. * Must be called with the target process locked. */

Source from the content-addressed store, hash-verified

1022 * Must be called with the target process locked.
1023 */
1024static void
1025fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp)
1026{
1027 struct thread *td;
1028
1029 PROC_LOCK_ASSERT(p, MA_OWNED);
1030
1031 kp->ki_estcpu = 0;
1032 kp->ki_pctcpu = 0;
1033 FOREACH_THREAD_IN_PROC(p, td) {
1034 thread_lock(td);
1035 kp->ki_pctcpu += sched_pctcpu(td);
1036 kp->ki_estcpu += sched_estcpu(td);
1037 thread_unlock(td);
1038 }
1039}
1040
1041/*
1042 * Fill in any information that is common to all threads in the process.

Callers 1

fill_kinfo_procFunction · 0.85

Calls 2

sched_pctcpuFunction · 0.70
sched_estcpuFunction · 0.70

Tested by

no test coverage detected