mirror of https://github.com/xzeldon/htop.git
Merge pull request #391 from gaod/master
Add MEM% for processes in process list on FreeBSD.
This commit is contained in:
commit
d10f4f615a
|
@ -483,6 +483,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
|
||||||
proc->time = (kproc->ki_runtime + 5000) / 10000;
|
proc->time = (kproc->ki_runtime + 5000) / 10000;
|
||||||
|
|
||||||
proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale);
|
proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale);
|
||||||
|
proc->percent_mem = 100.0 * (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem);
|
||||||
|
|
||||||
if (proc->percent_cpu > 0.1) {
|
if (proc->percent_cpu > 0.1) {
|
||||||
// system idle process should own all CPU time left regardless of CPU count
|
// system idle process should own all CPU time left regardless of CPU count
|
||||||
if ( strcmp("idle", kproc->ki_comm) == 0 ) {
|
if ( strcmp("idle", kproc->ki_comm) == 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue