DroidPerf
1.0.0 · GitHub
More about this app
Real-time FPS and hardware telemetry overlay that measures true frame delivery from SurfaceFlinger; Shizuku is required for target FPS, frame times and shell-level app detection.
DroidPerf
A lightweight, real-time performance overlay for Android. It renders an on-screen HUD over apps and games to display live hardware telemetry: target FPS, frame times, CPU/GPU utilization, clock speeds, thermals, RAM, and battery draw.
Unlike typical overlays that measure their own frame render callbacks, DroidPerf hooks directly into Android's graphics compositor (SurfaceFlinger) to measure true frame delivery from the foreground app.
Features
- Game FPS & Frame Times: Sub-millisecond latency tracking via SurfaceFlinger timestamps (requires Root or Shizuku).
- CPU & GPU Metrics: Total/per-core usage, current frequencies, thermal zones, and vendor-specific GPU load (Adreno KGSL, devfreq).
- Memory & System: Detailed RAM breakdown (active, cached, available) and foreground package detection.
- Battery Telemetry: Real-time voltage, current, and wattage draw.
- Multiple OSD Styles: Includes RTSS (RivaTuner style), Classic compact, and Minimal HUD modes.
- Zero Fabrication: If a sensor or sysfs node is restricted by OEM firmware, it cleanly displays
N/Arather than guessing or interpolating.
Access Modes
Telemetry depth depends on device privileges. DroidPerf automatically detects available methods and saves your choice:
| Mode | Requirements | Capabilities |
|---|---|---|
| Standard | None | CPU usage/frequency, RAM, battery, network, basic thermals |
| Shizuku | Shizuku running (Wireless ADB) | Target FPS, frame times, shell-level app detection |
| Root | Magisk, KernelSU, or APatch | Full hardware sysfs access, dumpsys SurfaceFlinger, low-level thermals |
Shizuku Setup
- Install and start Shizuku.
- In DroidPerf, select Shizuku as your access mode and approve the authorization prompt.
DroidPerf communicates with a standalone UserService binder running under UID 2000 (shell).
Root Setup
Open DroidPerf and grant superuser access when prompted by KernelSU, Magisk, or APatch. Shell commands are strictly filtered through a static whitelist (SafeCommands).
How FPS Measurement Works
Android apps cannot inspect another app's Choreographer render pipeline without platform signature permissions. To measure game FPS accurately without modifying the target:
- DroidPerf resolves the active
SurfaceViewor window layer fromdumpsys SurfaceFlinger --list. - It samples timestamps via
dumpsys SurfaceFlinger --latency <layer>(ordumpsys gfxinfofallback). - Frame delta is calculated from hardware
actual-presenttimestamps:FPS = (presentedFrames - 1) / (lastPresent - firstPresent) - Sentinels and pending VSYNC timestamps (
Long.MAX_VALUE) are discarded to avoid skew during scene loads.
Hardware & OEM Support
- Qualcomm Adreno: Direct utilization reads via
/sys/class/kgsl/kgsl-3d0/gpubusy. - ARM Mali / Samsung Xclipse: Polled via
/sys/class/devfreq/*/loadwhere exposed by the vendor kernel. - Thermals: Scans
/sys/class/thermal/thermal_zone*and matches zone types (e.g.,cpu-1-usr,gpu-thermal,battery) instead of relying on fragile index numbers.
Building
Requires JDK 17 and Android SDK Platform 35.
# Build debug APK
./gradlew :app:assembleDebug
# Run unit tests
./gradlew :app:testDebugUnitTest
# Build optimized release
./gradlew :app:assembleRelease
Built APKs are located in app/build/outputs/apk/.
Architecture
app/src/main/java/com/droidperf/
├── domain/ Metric data structures, snapshot models, access enums
├── system/ SysFs readers, hardware capability probing, shell wrappers
├── monitoring/ Isolated metric collectors (FPS, CPU, GPU, RAM, Battery, Thermal)
├── overlay/ Floating window lifecycle, Canvas renderer, RTSS layout engine
├── shizuku/ Shizuku IPC binder & UserService bridge
├── settings/ Preferences datastore, layout presets, position state
├── ui/ Configuration activities, setup wizard, access selector
└── di/ ServiceLocator
Every metric is isolated: if a specific sysfs interface or shell command fails, only that single gauge marks itself unavailable while the rest of the overlay continues updating.
License & Privacy
DroidPerf runs completely offline. It contains no tracking, telemetry SDKs, or network request endpoints. Network permissions are used solely to measure local Wi-Fi/cellular throughput and ping latency on user request.
How Shizuku is used
Can measure live game FPS, detect the foreground app and read CPU, GPU and thermal sensors via `dumpsys` and `cat /sys` through Shizuku.
This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.
How this app uses Shizuku
Shizuku is used to run a fixed set of read-only system checks with shell privilege so the overlay can show live game and hardware stats.
- Measure game FPS: shows the foreground game's real frame rate and frame time from SurfaceFlinger layer statistics using
dumpsys SurfaceFlinger --list,dumpsys SurfaceFlinger --latency,dumpsys SurfaceFlinger --timestatsanddumpsys gfxinfo framestatsthrough Shizuku. - Detect foreground game: identifies which app is currently in the foreground for FPS targeting with the
dumpsys activity activitiesshell command through Shizuku when usage access is not granted. - Read hardware telemetry: reads CPU usage and frequencies, GPU load and clocks, and temperature zones with
cat /proc/stat,cat /syssensor nodes andls /syslistings through Shizuku when the app process is blocked from reading them directly.
Android APIs or commands used
dumpsys SurfaceFlinger --list
dumpsys SurfaceFlinger --latencydumpsys SurfaceFlinger --timestats -enabledumpsys SurfaceFlinger --timestats -dumpdumpsys SurfaceFlinger --timestats -cleardumpsys SurfaceFlinger --timestats -disabledumpsys gfxinfo framestatsdumpsys activity activitiescat /proc/statcat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freqcat /sys/class/devfreq/*/cur_freqcat /sys/class/devfreq/*/loadcat /sys/class/kgsl/kgsl-3d0/gpubusycat /sys/class/kgsl/kgsl-3d0/gpuclkcat /sys/*ls /sys/*cat /proc/*ls /proc/*
Notable details
Without Shizuku, FPS and frame time stay unavailable and foreground detection depends on the Usage access permission, while some CPU, GPU and thermal readings may still appear when directly readable by the app.
Changelog
What's new for version 1.0.0
DroidPerf v1.0.0
Features
- Real-time FPS & Frame Times (SurfaceFlinger latency tracking)
- Overlay Styles:
- RTSS (RivaTuner-style grouped layout)
- Classic (Detailed vertical list)
- Minimal (Compact single-line HUD)
- Hardware Telemetry:
- CPU usage (total & per-core), frequencies, and temperatures
- GPU usage, clock speeds, and thermals (Adreno KGSL & devfreq)
- RAM usage and real-time battery draw (W / mA)
- Foreground app detection
Permissions
10 permissions requested