mgradwohl / mgradwohl/tasksmack
[Feature] CPU Details Summary Panel (sockets, logical processors, cache, virtualization, uptime)
- Dominant language
- C++
- Stars
- 1
- Forks
- 0
- Avg merge
- 3h 4m
- Merged PRs (30d)
- 115
Description
## Problem Statement
TaskSmack's System Overview surfaces CPU model, core count, live frequency, uptime, and process/thread counts only as scattered inline header text (`SystemMetricsPanel.cpp`, ~lines 474-522). Task Manager's Performance → CPU tab and TaskSlinger's equivalent view instead group a much richer set of CPU facts into one glanceable block: Utilization, Kernel time, Speed, Processes, Threads, Handles, Up time, Base speed, Sockets, Cores, Logical processors, Virtualization (+ hypervisor), Virtualization-based security, Security services, Hypervisor platform, and L1/L2/L3 cache sizes.
## Proposed Solution
A dedicated "CPU Details" block in System Overview presenting these as a labeled grid, reusing the existing 2-column `ImGui::BeginTable` pattern already used elsewhere (e.g. `ProcessDetailsPanel`'s GPU/basic-info tables). Most of the live values (utilization, current speed, process/thread counts, uptime) are already computed today and just need to move into one structured block instead of free-floating header text. New static facts need new probe fields: physical socket count, true logical-processor count, base/rated clock speed, L1/L2/L3 cache sizes, a system-wide handle count, kernel-mode CPU time as its own labeled metric, and (Windows-only) virtualization/hypervisor/VBS security status.
## Alternatives Considered
Keep the current scattered header-text presentation — rejected. This isn't a TaskSlinger invention, it's Windows Task Manager's own actual Performance-tab layout; grouping it well is exactly the "glanceable at a glance" value this whole app category exists for.
## Additional Context
Notable existing gap found while scoping this: `SystemSnapshot::coreCount` (`src/Domain/SystemModel.cpp:362`, `= counters.cpuPerCore.size()`) is actually counting **logical processors** (it comes from per-CPU entries in `/proc/stat` on Linux and per-logical-processor counters on Windows, both of which include SMT/hyperthreading), not physical cores. So today's "N cores" header text is mislabeled — it's really logical-processor count. This issue should introduce the true physical-core and socket counts as new, separate fields rather than relabel the existing one.
## Implementation Notes
- **Linux**: sockets/physical cores/logical processors from `/proc/cpuinfo` (`physical id`, `siblings`, `cpu cores` fields); cache sizes from `/sys/devices/system/cpu/cpu0/cache/index*/size`; base/rated frequency from `/sys/devices/system/cpu/cpu0/cpufreq/base_frequency` or `bios_limit`/`cpuinfo_max_freq` as fallback (or parsed from `/proc/cpuinfo`'s model-name string as a last resort); kernel-time % is already derivable from the existing `/proc/stat` user/system split (`LinuxSystemProbe` already reads this for the existing CPU breakdown per `completed-features.md`). No virtualization/hypervisor/VBS concept exists on Linux — that block is Windows-only and should be hidden via a capability flag there.
- **Windows**: `GetLogicalProcessorInformationEx` for sockets/physical-core/logical-processor/cache-size topology in one call; base speed from the CPU registry `~MHz` value (a registry path this codebase already partially touches for `cpuModel` — see closed issues #718/#727/#728 about hardening that specific read); virtualization/hypervisor/VBS status via `IsProcessorFeaturePresent`/`GetSystemFirmwareTable` or the `Win32_DeviceGuard` WMI class; system-wide handle count via summing `GetProcessHandleCount` or `NtQuerySystemInformation(SystemHandleInformation)`'s total (process enumeration already uses `NtQuerySystemInformation`, so this is an adjacent call).
- Should follow the existing `ProcessCapabilities`-style optional-field pattern, but at the system level, so fields unavailable on a given OS/hardware (e.g. VBS on non-Win11, cache size when unreadable) degrade gracefully instead of blocking the whole block.
Source: TaskSlinger CPU details panel (screenshot attached) / Windows Task Manager Performance → CPU tab.
Contributor guide
Research direction
Start with the scattered CPU metrics in SystemMetricsPanel.cpp around lines 474-522 and the coreCount calculation in src/Domain/SystemModel.cpp:362. Read LinuxSystemProbe, the existing ProcessCapabilities optional-field pattern, and the referenced completed-features.md CPU breakdown before tracing the Windows probe paths. Done means System Overview has a labeled CPU Details block with the requested live and static fields, platform-specific virtualization data, and graceful omissions where hardware or OS data is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- desktop-dev, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100