* Calculate the kinfo_proc members which contain process-wide * informations. * Must be called with the target process locked. */
| 1022 | * Must be called with the target process locked. |
| 1023 | */ |
| 1024 | static void |
| 1025 | fill_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. |
no test coverage detected