mirror of https://github.com/xzeldon/htop.git
commit
e906c0dddb
|
@ -199,6 +199,7 @@ void ProcessList_goThroughEntries(ProcessList* this) {
|
|||
|
||||
proc->show = ! ((hideKernelThreads && Process_isKernelThread(fp)) || (hideUserlandThreads && Process_isUserlandThread(proc)));
|
||||
|
||||
|
||||
if (!preExisting) {
|
||||
fp->jid = kproc->ki_jid;
|
||||
proc->pid = kproc->ki_pid;
|
||||
|
@ -206,7 +207,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
|
|||
fp->kernel = 1;
|
||||
else
|
||||
fp->kernel = 0;
|
||||
proc->ppid = kproc->ki_ppid;
|
||||
proc->tpgid = kproc->ki_tpgid;
|
||||
proc->tgid = kproc->ki_pid;
|
||||
proc->session = kproc->ki_sid;
|
||||
|
@ -219,12 +219,19 @@ void ProcessList_goThroughEntries(ProcessList* this) {
|
|||
proc->comm = FreeBSDProcessList_readProcessName(fpl->kd, kproc, &proc->basenameOffset);
|
||||
fp->jname = FreeBSDProcessList_readJailName(kproc);
|
||||
} else {
|
||||
if(fp->jid != kproc->ki_jid) {
|
||||
fp->jid = kproc->ki_jid;
|
||||
free(fp->jname);
|
||||
fp->jname = FreeBSDProcessList_readJailName(kproc);
|
||||
}
|
||||
if (settings->updateProcessNames) {
|
||||
free(proc->comm);
|
||||
proc->comm = FreeBSDProcessList_readProcessName(fpl->kd, kproc, &proc->basenameOffset);
|
||||
}
|
||||
}
|
||||
|
||||
proc->ppid = kproc->ki_ppid;
|
||||
|
||||
proc->m_size = kproc->ki_size / pageSizeKb / 1000;
|
||||
proc->m_resident = kproc->ki_rssize; // * pageSizeKb;
|
||||
proc->nlwp = kproc->ki_numthreads;
|
||||
|
|
|
@ -176,14 +176,14 @@ double Platform_setCPUValues(Meter* this, int cpu) {
|
|||
percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6];
|
||||
} else {
|
||||
percent = v[0]+v[1]+v[2]+v[3]+v[4];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v[2] = cpuData->systemAllPeriod / total * 100.0;
|
||||
v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0;
|
||||
Meter_setItems(this, 4);
|
||||
percent = v[0]+v[1]+v[2]+v[3];
|
||||
}
|
||||
percent = MIN(100.0, MAX(0.0, percent));
|
||||
percent = MIN(100.0, MAX(0.0, percent));
|
||||
if (isnan(percent)) percent = 0.0;
|
||||
return percent;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue