For a Systems Engineer, the command line interface (CLI) is the surgical theater. While GUI apps are convenient, they consume significant resources (CPU/GPU) to render their interfaces, which can skew your measurements (the "Observer Effect").
CLI tools have near-zero overhead, allowing you to observe the system in its natural state.
The simplest way to check system health.
su -c uptimeOutput:
12:34:56 up 10 days, 2:30, load average: 4.12, 3.88, 3.50
- 1min (4.12): Immediate system state. If this is > (CPU Cores * 2), you have a bottleneck.
- 5min (3.88): A short-term trend.
- 15min (3.50): The long-term baseline.
Tip
If 1min > 15min, the load is increasing (something just happened).
If 1min < 15min, the load is decreasing (the system is recovering).
The standard Linux process viewer. On Android, the toybox version is limited but powerful if you know the flags.
To see the top 10 processes consuming the most CPU right now:
su -c top -m 10 -s cpu| Flag | Function |
|---|---|
-m 10 |
Limit output to the top 10 entries (reduces clutter). |
-s cpu |
Sort by CPU usage (default is often PID or VSS). |
-d 1 |
Update every 1 second. |
Look for the S (State) column:
R: Running (Healthy).S: Sleeping (Healthy).D: Uninterruptible Sleep (I/O Wait / Kernel Lock). If you see many 'D' states, your storage or kernel is the problem, not the app.Z: Zombie (Parent process didn't clean up).
Unlike top, which shows an instantaneous snapshot, dumpsys aggregates data over a short window (usually the last few seconds/minutes). It is aware of Android packages.
su -c dumpsys cpuinfoWhy it's useful: It breaks down usage by:
- User Stack: (App logic)
- Kernel Stack: (System calls)
If an app shows 5% User and 40% Kernel, that app is spamming system calls (e.g., trying to open a file 10,000 times a second).
Essential for diagnosing Memory Thrashing and Context Switching.
su -c vmstat 1(Prints a new line every 1 second)
r(run): Processes waiting for CPU. If this is consistently high, you need a faster CPU or fewer background apps.swpd: Swap used (zRAM on Android).bi/bo(Blocks In/Out): Disk Read/Write operations. High numbers here = High I/O Load.in(Interrupts): Hardware demanding attention.cs(Context Switches): The CPU switching tasks.- Normal: 500 - 5,000.
- Bad: > 15,000 (The CPU is spending more time switching tasks than doing them).
htop is not built-in but can be installed via Termux or a Magisk Module.
It provides a color-coded, visual bar graph of per-core usage.
- Green: User processes.
- Red: Kernel threads.
- Blue: Low-priority threads.
Pro Tip: Press F2 (Setup) -> Display Options -> Check "Detailed CPU Time". This breaks down usage into IO-Wait, IRQ, and SoftIRQ.
- Check Global Health:
uptime-> Is load high? - Identify Culprit:
top -m 5-> Is it a specific app? - Check Type:
vmstat 1-> Is it CPU crunching (highus) or I/O waiting (highwa/bi/bo)? - Deep Dive: If it's a specific app, use Advanced Profiling.