mirror of https://github.com/xzeldon/htop.git
FreeBSD: use KERN_PROC_PROC with kvm_getprocs to avoid erroneously combining LWPs
This commit is contained in:
parent
0cf3cfa3af
commit
cc8375f9ea
|
@ -424,7 +424,7 @@ void ProcessList_goThroughEntries(ProcessList* this) {
|
||||||
|
|
||||||
int cpus = this->cpuCount;
|
int cpus = this->cpuCount;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
struct kinfo_proc* kprocs = kvm_getprocs(fpl->kd, KERN_PROC_ALL, 0, &count);
|
struct kinfo_proc* kprocs = kvm_getprocs(fpl->kd, KERN_PROC_PROC, 0, &count);
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
struct kinfo_proc* kproc = &kprocs[i];
|
struct kinfo_proc* kproc = &kprocs[i];
|
||||||
|
@ -494,10 +494,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
|
||||||
proc->percent_cpu = proc->percent_cpu / (double) cpus;
|
proc->percent_cpu = proc->percent_cpu / (double) cpus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isIdleProcess == false && proc->percent_cpu >= 99.8) {
|
|
||||||
// don't break formatting
|
|
||||||
proc->percent_cpu = 99.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
proc->priority = kproc->ki_pri.pri_level - PZERO;
|
proc->priority = kproc->ki_pri.pri_level - PZERO;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue