diff --git a/scheds/rust-user/scx_rusty/src/main.rs b/scheds/rust-user/scx_rusty/src/main.rs index 3d802e27d..ff7cc9d80 100644 --- a/scheds/rust-user/scx_rusty/src/main.rs +++ b/scheds/rust-user/scx_rusty/src/main.rs @@ -190,17 +190,6 @@ fn read_total_cpu(reader: &procfs::ProcReader) -> Result { fn calc_util(curr: &procfs::CpuStat, prev: &procfs::CpuStat) -> Result { match (curr, prev) { ( - procfs::CpuStat { - user_usec: Some(prev_user), - nice_usec: Some(prev_nice), - system_usec: Some(prev_system), - idle_usec: Some(prev_idle), - iowait_usec: Some(prev_iowait), - irq_usec: Some(prev_irq), - softirq_usec: Some(prev_softirq), - stolen_usec: Some(prev_stolen), - .. - }, procfs::CpuStat { user_usec: Some(curr_user), nice_usec: Some(curr_nice), @@ -212,6 +201,17 @@ fn calc_util(curr: &procfs::CpuStat, prev: &procfs::CpuStat) -> Result { stolen_usec: Some(curr_stolen), .. }, + procfs::CpuStat { + user_usec: Some(prev_user), + nice_usec: Some(prev_nice), + system_usec: Some(prev_system), + idle_usec: Some(prev_idle), + iowait_usec: Some(prev_iowait), + irq_usec: Some(prev_irq), + softirq_usec: Some(prev_softirq), + stolen_usec: Some(prev_stolen), + .. + }, ) => { let idle_usec = curr_idle - prev_idle; let iowait_usec = curr_iowait - prev_iowait;