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
95d19843
Commit
95d19843
authored
May 16, 2016
by
Hisham Muhammad
Browse files
Merge pull request #485 from Cubox-/master
Fix FreeBSD CPU bars calculation
parents
7d72715a
5776cb56
Changes
1
Hide whitespace changes
Inline
Side-by-side
freebsd/Platform.c
View file @
95d19843
...
@@ -163,15 +163,15 @@ double Platform_setCPUValues(Meter* this, int cpu) {
...
@@ -163,15 +163,15 @@ double Platform_setCPUValues(Meter* this, int cpu) {
double
percent
;
double
percent
;
double
*
v
=
this
->
values
;
double
*
v
=
this
->
values
;
v
[
CPU_METER_NICE
]
=
cpuData
->
nicePercent
*
cpus
;
v
[
CPU_METER_NICE
]
=
cpuData
->
nicePercent
;
v
[
CPU_METER_NORMAL
]
=
cpuData
->
userPercent
*
cpus
;
v
[
CPU_METER_NORMAL
]
=
cpuData
->
userPercent
;
if
(
this
->
pl
->
settings
->
detailedCPUTime
)
{
if
(
this
->
pl
->
settings
->
detailedCPUTime
)
{
v
[
CPU_METER_KERNEL
]
=
cpuData
->
systemPercent
*
cpus
;
v
[
CPU_METER_KERNEL
]
=
cpuData
->
systemPercent
;
v
[
CPU_METER_IRQ
]
=
cpuData
->
irqPercent
*
cpus
;
v
[
CPU_METER_IRQ
]
=
cpuData
->
irqPercent
;
Meter_setItems
(
this
,
4
);
Meter_setItems
(
this
,
4
);
percent
=
v
[
0
]
+
v
[
1
]
+
v
[
2
]
+
v
[
3
];
percent
=
v
[
0
]
+
v
[
1
]
+
v
[
2
]
+
v
[
3
];
}
else
{
}
else
{
v
[
2
]
=
cpuData
->
systemAllPercent
*
cpus
;
v
[
2
]
=
cpuData
->
systemAllPercent
;
Meter_setItems
(
this
,
3
);
Meter_setItems
(
this
,
3
);
percent
=
v
[
0
]
+
v
[
1
]
+
v
[
2
];
percent
=
v
[
0
]
+
v
[
1
]
+
v
[
2
];
}
}
...
...
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