FreeBSD: improve actual processor calculation logic

This commit is contained in:
Alexander Nedotsukov 2021-03-30 10:58:09 +03:00 committed by cgzones
parent 73f5ecf528
commit 5afb57b49e

View File

@ -572,7 +572,11 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale);
proc->percent_mem = 100.0 * proc->m_resident / (double)(super->totalMem);
proc->processor = kproc->ki_lastcpu;
if (kproc->ki_stat == SRUN && kproc->ki_oncpu != NOCPU) {
proc->processor = kproc->ki_oncpu;
} else {
proc->processor = kproc->ki_lastcpu;
}
proc->majflt = kproc->ki_cow;