Files
RedBear-OS/local/docs
vasilito 1dcdc5d39d redbear-power: v1.13 — Process tab (procfs)
Adds the 9th tab in the multi-view system: Process, reading
process state and memory from /proc/[pid]/stat on Linux hosts.
Last major top-like view, complementing hardware tabs
(Storage/Network/Sensors) with software state.

New module process.rs (215 lines, 9 unit tests):
- ProcessInfo: pid, comm, state, ppid, utime, stime, priority,
  nice, num_threads, vsize_kb, rss_kb
- parse_stat_line() handles (comm) with spaces like (Web Content)
  via last-')' extraction (per man 5 proc format)
- Field indices: state=0, ppid=1, utime=11, stime=12,
  priority=15, nice=16, num_threads=17, vsize=20, rss=21
- read_comm() fallback for parens-parsing failures
- ProcInfo::read() scans /proc, sorts by RSS desc, truncates to 50
- format_memory_kb() with binary unit suffix

Updated app.rs:
- New field processes: ProcInfo, refreshed every 13th tick
  (6.5 sec). 13-tick modulus coprime with all (3,4,5,7,11).
- TabId::Process variant (9th tab)
- TabId::next() cycles PerCpu → System → Info → Motherboard →
  Battery → Sensors → Network → Storage → Process → PerCpu

Updated render.rs:
- New render_process_panel() with PID/STATE/PRIO/NI/THR/RSS/VIRT/COMM
  columns. Comm truncated to 20 chars. Sort by RSS desc (top-like).
- render_tab_bar() for 9 tabs with hotkey 1-9
- render_once dumps Process panel for headless verification

Updated main.rs:
- mod process; declaration
- New dispatch arm TabId::Process => render_process_panel
- Hotkey 9 jumps to Process tab
- render_process_panel added to imports

Linux host smoke test (596 processes, top 50):
- opencode 3.7 GiB, thunderbird 2.1 GiB, plasmashell 517 MiB
- kwin_wayland shows PRIO=-2 (real-time scheduling)
- Total RSS: 17.5 GiB

Unit tests: 43/43 pass (5 bench + 12 sensor + 7 network + 10 storage +
9 process).
Cross-compile SHA256: 2c30f86dce574f173efdcf8eb588f83abd8f0bdf2c5a2678452dd0e6a244dbf2.

Docs: improvement plan §37, CONSOLE-TO-KDE §3.3.2 v1.13,
RATATUI-APP-PATTERNS §13.14 + §14 (19 modules, 43 tests).
2026-06-20 20:41:44 +03:00
..