summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2021-12-22 14:57:15 -0500
committerClementTsang <cjhtsang@uwaterloo.ca>2021-12-22 14:57:15 -0500
commiteaff52c8a4fbe979910d2395835805c20ed0f925 (patch)
treead14e8ae01c9d41ac345f4f3d110ba457d3fe0a9
parent5526fe738d088cad402a49d469b0d52e992f77e9 (diff)
docs: Add comment/changelog about not including guest twice0.6.6
-rw-r--r--CHANGELOG.md4
-rw-r--r--src/app/data_harvester/processes/linux.rs1
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16a0e8a2..4cdaceae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#637](https://github.com/ClementTsang/bottom/pull/637): Fix process CPU calculation if /proc/stat CPU line has less values than expected
+## Changes
+
+- [#637](https://github.com/ClementTsang/bottom/pull/637): Remove duplicate guest time in process CPU calculation
+
## [0.6.5] - 2021-12-19
## Bug Fixes
diff --git a/src/app/data_harvester/processes/linux.rs b/src/app/data_harvester/processes/linux.rs
index 53c93e05..081af802 100644
--- a/src/app/data_harvester/processes/linux.rs
+++ b/src/app/data_harvester/processes/linux.rs
@@ -53,6 +53,7 @@ fn calculate_idle_values(line: String) -> (f64, f64) {
let steal: f64 = str_to_f64(val.next());
// Note we do not get guest/guest_nice, as they are calculated as part of user/nice respectively
+ // See https://github.com/htop-dev/htop/blob/main/linux/LinuxProcessList.c
let idle = idle + iowait;
let non_idle = user + nice + system + irq + softirq + steal;