The Linux /proc/stat fields "guest" and "guest_nice" are already
included in "user" and "nice". In Proc::collect do like Cpu::collect
does and don't double count them. The double-counting caused the CPU
usage denominator to be too large when VM guests were active, causing
the reported CPU usage percentages of all processes to be too small.
Closes: https://github.com/aristocratos/btop/issues/1608
coreCount now reflects only the schedulable CPUs. With hw.smt=0 on a
4-core/8-thread machine, coreCount becomes 4, so btop allocates 4
display slots instead of 8.
The collect loop now also checks CPUSTATS_ONLINE for each CPU and skips
offline CPUs, such as disabled hyperthreads.
btop uses i / 2 as the third MIB index when it should be i, exactly as
top does. This causes it to query the same CPU twice in a row and skip
half the CPUs entirely.
Also use the correct size for a single cpustats struct.
Process signal popup menus use the "current" selected process, which can drift
around. Fix by retaining the initial PID at popup creation.
Closes: https://github.com/aristocratos/btop/issues/846
- Add CFRef<T> template for CoreFoundation types (CFRelease)
- Add IORef wrapper for IOKit object types (IOObjectRelease)
- Refactor GPU code to use RAII wrappers for all local CF/IO objects
- Add 'apple' to shown_gpus description in btop_menu.cpp
- Wrap AppleSilicon::shutdown() call and declaration with #ifdef __APPLE__
so Linux GPU builds don't get undefined reference errors
- Add IOReport library linking in CMakeLists.txt for macOS CMake builds
Add GPU monitoring for Apple Silicon Macs using the IOReport framework
and IOHIDEventSystem for temperature readings.
Metrics supported:
- GPU utilization (from GPU Performance States residency)
- GPU power consumption (from Energy Model channel)
- GPU temperature (from IOHIDEventSystem thermal sensors)
- GPU clock speed (from DVFS frequency table + residency weighting)
- Memory usage (unified memory architecture, reports system RAM)
Implementation follows the existing Nvml/Rsmi/Intel backend pattern with
init/shutdown/collect<is_init> template functions in a new AppleSilicon
namespace under Gpu.
Build system changes:
- Enable GPU_SUPPORT on macOS in both CMakeLists.txt and Makefile
- Link IOReport library on macOS
- Add 'apple' to shown_gpus vendor filter
Closes#955