How aristocratos/btop works
btop++ is an interactive terminal system-resource monitor. Its principal workflow is to start the monitor, collect platform-specific CPU, memory, disk, network, process and GPU statistics, and present them in configurable terminal panels; users interact through keyboard input and menus. The graph preserves the documented Linux GPU capability and platform-specific collectors. Several links are dashed because the sampled material identifies modules and capabilities but does not show the corresponding runtime calls.
Main entry points: btop.cpp Monitor runtime · btop_collect.cpp macOS stats · main.cpp Program entry · btop_menu.cpp Menus
Components 23
Application runtime
- Program entry
src/main.cpp - Monitor runtime
src/btop.cpp - CLI options
src/btop_cli.cpp - Configuration
src/btop_config.cpp
Terminal interface
- Input handling
src/btop_input.cpp - Menus
src/btop_menu.cpp - Panel rendering
src/btop_draw.cpp - Themes
src/btop_theme.cpp
Platform monitoring
- Linux stats
src/linux/btop_collect.cpp - FreeBSD stats
src/freebsd/btop_collect.cpp - NetBSD stats
src/netbsd/btop_collect.cpp - OpenBSD stats
src/openbsd/btop_collect.cpp - macOS stats
src/osx/btop_collect.cpp - Intel GPU support
src/linux/intel_gpu_top/intel_gpu_top.c - macOS sensors
src/osx/sensors.cpp - Apple SMC
src/osx/smc.cpp - DRM interfaces
src/linux/intel_gpu_top/drm.h
Shared support
- Shared state
src/btop_shared.cpp - Terminal utilities
src/btop_tools.cpp - Logging
src/btop_log.cpp - fmt formatting
include/fmt/format.h - Unicode widths
include/widechar_width.hpp
Other components
- Monitor user
Connections 22
- Monitor user → Program entry: starts monitor
README.md - Program entry → Monitor runtime: enters runtime
- Monitor runtime → CLI options: handles options
src/btop.cpp - Monitor runtime → Linux stats: collects stats
- Monitor runtime → FreeBSD stats: collects stats
- Monitor runtime → NetBSD stats: collects stats
- Monitor runtime → OpenBSD stats: collects stats
- Monitor runtime → macOS stats: collects stats
- Linux stats → Intel GPU support: uses GPU support
src/linux/btop_collect.cpp - Monitor runtime → Configuration: uses settings
src/btop.cpp - Monitor runtime → Input handling: handles input
src/btop.cpp - Monitor runtime → Panel rendering: renders panels
src/btop.cpp - Monitor runtime → Menus: opens menus
src/btop.cpp - Menus → Configuration: edits settings
src/btop_menu.cpp - Panel rendering → Themes: uses theme
src/btop_draw.cpp - Monitor runtime → Shared state: uses shared state
src/btop.cpp - Monitor runtime → Terminal utilities: uses utilities
src/btop.cpp - Monitor runtime → Logging: logs events
src/btop.cpp - macOS stats → macOS sensors: uses sensors
src/osx/btop_collect.cpp - macOS stats → Apple SMC: uses SMC
src/osx/btop_collect.cpp - Terminal utilities → Unicode widths: uses widths
src/btop_tools.cpp - fmt formatting → DRM interfaces