How sayujya-apte/atop works
Atop is a Linux process viewer with an ncurses interface. Its main loop enumerates processes, accepts keyboard navigation, and refreshes both the process list and system summary; selecting a row changes the highlight, but no detail view is shown. Process data and system-wide CPU and memory statistics are separate stages, rendered by separate UI routines. The source shows reads from Linux procfs and ncurses calls; no persistence or other integrations are documented. The graph reflects the sampled C sources and README, not unsampled implementation details.
Main entry points: main.c Interactive loop · print_menu.c Process list · get_sys_info.c System metrics · get_proc_info.c Process enumeration
Components 9
Application control
- Interactive loop
src/main.c
Process monitoring
- Process enumeration
src/get_proc_info.c - Process details
src/get_proc_info.c
System monitoring
- System metrics
src/get_sys_info.c
Terminal interface
- Process list
src/print_menu.c - System summary
src/print_menu.c
Other components
- Operator
- Linux procfs
- ncurses terminal
Connections 13
- Operator → Interactive loop: keyboard input
- Interactive loop → Process enumeration: refreshes PIDs
- Interactive loop → System metrics: gets CPU count
- Interactive loop → Process list: renders list
- Interactive loop → System summary: renders summary
- Process enumeration → Linux procfs: scans /proc
- Process list → Process details: gets row fields
- Process details → Linux procfs: reads status/stat
- System metrics → Linux procfs: reads stat/meminfo
- Process list → ncurses terminal: draws list
- System summary → System metrics: gets usage
- System summary → ncurses terminal: draws summary
- Interactive loop → ncurses terminal: handles windows