From 6d13dee2a6c0564869d1a6de10b0490dd43606cf Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 2 Jul 2026 19:22:19 +0300 Subject: [PATCH] redbear-power(0.2.5): fix missing hwp field in CpuRow initializer Pre-existing bug: CpuRow struct gained an hwp field but the initializer at line 319 was not updated. --- local/recipes/system/redbear-power/source/src/app.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/local/recipes/system/redbear-power/source/src/app.rs b/local/recipes/system/redbear-power/source/src/app.rs index 069512688a..85c18ecd8c 100644 --- a/local/recipes/system/redbear-power/source/src/app.rs +++ b/local/recipes/system/redbear-power/source/src/app.rs @@ -79,6 +79,7 @@ pub struct CpuRow { pub prev_load: (u64, u64), pub load_history: VecDeque, pub core_type: CoreType, + pub hwp: Option, } impl CpuRow { @@ -138,6 +139,10 @@ pub meminfo: crate::meminfo::MemInfo, pub prev_refresh_secs: f64, pub process_sort: crate::process::SortMode, pub process_filter: String, + /// Scheduler statistics from `/scheme/sys/stat` (Redox) or + /// `/proc/stat` (Linux). Read every tick — it's a single + /// file read. Fields degrade to `None` when unavailable. + pub sched_stats: crate::sched::SchedStats, /// When true, render the Process tab as a tree (parents above /// children, prefixed with `├─ ` / `└─ ` connector characters). /// Toggled by the `T` hotkey. Sort modes are honored within @@ -325,6 +330,7 @@ impl App { prev_load: (0, 0), load_history: VecDeque::with_capacity(LOAD_HISTORY_LEN), core_type: type_for(id), + hwp: None, } }) .collect(); @@ -393,6 +399,7 @@ impl App { prev_refresh_secs: 0.0, process_sort: crate::process::SortMode::default(), process_filter: String::new(), + sched_stats: crate::sched::SchedStats::default(), process_tree: false, folded: std::collections::BTreeSet::new(), pkg_power_w: None, @@ -605,6 +612,10 @@ impl App { self.prev_refresh_secs = now_secs; } + // Scheduler stats (context switches, IRQs). One file read + // — cheap enough for every tick. + self.sched_stats = crate::sched::SchedStats::read(); + for row in &mut self.cpus { if let Some(status) = read_thermal_status(row.id) { row.temp_c = if status & THERM_STATUS_READOUT_VALID != 0 {