disk-load's cpu_top names the processes inside one unit #600

Merged
mesh-tools merged 3 commits from fix/741-cpu-by-process into main 2026-11-03 07:43:21 +00:00
Member

Under issue 741 (reopened 2026-11-03). cpu_top ranked units and containers only, so g14's desktop session (one unit, about 170 processes), which keeps one to one and a half cores busy and the fans loud, could not be explained without a shell. cpu_top gains an optional unit (a unit name or a cgroup path): that unit's processes (and its child cgroups'), ranked by CPU over the window from /proc//stat read at both ends, with pid, the program (comm and argv[0] only, never the arguments, which may carry a secret), cpu_pct, share of the unit's busy time and threads. A pid reused in the window is skipped (its starttime changed); a path holding .. or leaving /sys/fs/cgroup is refused. Read-only, no root.

Quick fix (comm and argv[0]) chosen over the thorough one (docker's secret-shape rules moved into mesh-sdk and applied to the whole command line), which needs a mesh-sdk change asked of the operator first. Test: rows of TestCPUTopRanksAUnitsProcesses (the only new function; disk-load has about 36 unit tests); each fix's row fails without it.

Reviewed-by: review-741@shanks at dd4c53eefb

https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL

Under issue 741 (reopened 2026-11-03). cpu_top ranked units and containers only, so g14's desktop session (one unit, about 170 processes), which keeps one to one and a half cores busy and the fans loud, could not be explained without a shell. cpu_top gains an optional `unit` (a unit name or a cgroup path): that unit's processes (and its child cgroups'), ranked by CPU over the window from /proc/<pid>/stat read at both ends, with pid, the program (comm and argv[0] only, never the arguments, which may carry a secret), cpu_pct, share of the unit's busy time and threads. A pid reused in the window is skipped (its starttime changed); a path holding `..` or leaving /sys/fs/cgroup is refused. Read-only, no root. Quick fix (comm and argv[0]) chosen over the thorough one (docker's secret-shape rules moved into mesh-sdk and applied to the whole command line), which needs a mesh-sdk change asked of the operator first. Test: rows of TestCPUTopRanksAUnitsProcesses (the only new function; disk-load has about 36 unit tests); each fix's row fails without it. Reviewed-by: review-741@shanks at dd4c53eefb232ac1b6e1dda40c02e433da14c2be https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
mesh-tools added 3 commits 2026-11-03 01:05:28 +00:00
Author
Member

Delivery novox/mesh-catalog@dd4c53eefb23 — merged since 2026-11-03T07:43:23Z

Source — source.main moved to novox/mesh-catalog@4915ff5d29. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Transitions

  • 2026-11-03 01:05 (new) → proposed (announced): novox/mesh-catalog#600's head announced
  • 2026-11-03 01:05 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false)
  • 2026-11-03 07:43 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@dd4c53eefb23` — **merged** since 2026-11-03T07:43:23Z **Source** — source.main moved to novox/mesh-catalog@4915ff5d293f. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Transitions** - 2026-11-03 01:05 (new) → proposed (announced): novox/mesh-catalog#600's head announced - 2026-11-03 01:05 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false) - 2026-11-03 07:43 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
mesh-tools merged commit 4915ff5d29 into main 2026-11-03 07:43:21 +00:00
mesh-tools deleted branch fix/741-cpu-by-process 2026-11-03 07:43:21 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#600