| 86 | #define BOTH 3 |
| 87 | |
| 88 | static int |
| 89 | proc_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 | |
| 110 | static int |
| 111 | thread_compare(struct thread *td, struct thread *td2) |
no test coverage detected