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

Function proc_sum

freebsd/kern/tty_info.c:88–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86#define BOTH 3
87
88static int
89proc_sum(struct proc *p, fixpt_t *estcpup)
90{
91 struct thread *td;
92 int estcpu;
93 int val;
94
95 val = 0;
96 estcpu = 0;
97 FOREACH_THREAD_IN_PROC(p, td) {
98 thread_lock(td);
99 if (TD_ON_RUNQ(td) ||
100 TD_IS_RUNNING(td))
101 val = 1;
102 estcpu += sched_pctcpu(td);
103 thread_unlock(td);
104 }
105 *estcpup = estcpu;
106
107 return (val);
108}
109
110static int
111thread_compare(struct thread *td, struct thread *td2)

Callers 1

proc_compareFunction · 0.85

Calls 1

sched_pctcpuFunction · 0.70

Tested by

no test coverage detected