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

Function rufetch

freebsd/kern/kern_resource.c:1164–1178  ·  view source on GitHub ↗

* Update the rusage_ext structure and fetch a valid aggregate rusage * for proc p if storage for one is supplied. */

Source from the content-addressed store, hash-verified

1162 * for proc p if storage for one is supplied.
1163 */
1164void
1165rufetch(struct proc *p, struct rusage *ru)
1166{
1167 struct thread *td;
1168
1169 PROC_STATLOCK_ASSERT(p, MA_OWNED);
1170
1171 *ru = p->p_ru;
1172 if (p->p_numthreads > 0) {
1173 FOREACH_THREAD_IN_PROC(p, td) {
1174 ruxagg(p, td);
1175 rucollect(ru, &td->td_ru);
1176 }
1177 }
1178}
1179
1180/*
1181 * Atomically perform a rufetch and a calcru together.

Callers 4

fill_kinfo_proc_onlyFunction · 0.85
kern_process_cputimeFunction · 0.85
proc0_postFunction · 0.85
rufetchcalcFunction · 0.85

Calls 2

ruxaggFunction · 0.85
rucollectFunction · 0.85

Tested by

no test coverage detected