Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
6028e1b4
Commit
6028e1b4
authored
May 19, 2016
by
Hisham Muhammad
Browse files
Merge pull request #496 from tcreech/lwp_hack
FreeBSD: fix multithreaded CPU% in process list
parents
95d19843
cc8375f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
freebsd/FreeBSDProcessList.c
View file @
6028e1b4
...
@@ -427,7 +427,7 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -427,7 +427,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
];
...
@@ -495,10 +495,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -495,10 +495,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
isIdleProcess
=
true
;
isIdleProcess
=
true
;
}
}
}
}
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment