Skip to content

Commit

Permalink
Update the FreeBSD calculation to not include child usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceg committed Sep 12, 2023
1 parent 668c7f9 commit 61835a1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/freebsd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ pub(crate) unsafe fn get_process_data(
let status = ProcessStatus::from(kproc.ki_stat);

// from FreeBSD source /bin/ps/print.c
let accum_cpu_usage = (kproc.ki_runtime as f64 / 1000000.0) as f32
+ kproc.ki_childtime.tv_sec as f32
+ kproc.ki_childtime.tv_usec as f32 / 1000000.0;
let accum_cpu_usage = (kproc.ki_runtime as f64 / 1000000.0) as f32;

// from FreeBSD source /src/usr.bin/top/machine.c
let virtual_memory = kproc.ki_size as _;
Expand Down

0 comments on commit 61835a1

Please sign in to comment.