detect_jank_framesFind dropped/janky frames with detailed performance classification.
USE THIS WHEN: UI feels sluggish, scrolling stutters, animations aren't smooth, or
you need to quantify UI performance issues. Jank directly impacts user experience -
even a few janky frames can make an app feel unprofessional.
DETECTS:
- Frames exceeding deadline (16.67ms for 60fps, 8.33ms for 120fps)
- Jank source: Application vs SurfaceFlinger (system compositor)
- Severity: mild, moderate, severe based on deadline overrun
- CPU/UI thread time per frame
PARAMETERS:
- process_name: Exact app name from trace
- jank_threshold_ms: 16.67 (60fps) or 8.33 (120fps)
- severity_filter: ["severe", "moderate"] to focus on worst cases
OUTPUT INCLUDES:
- frame_id, timestamp, duration for correlation
- overrun_ms: How much the frame missed deadline
- jank_type and source (app vs system)
- CPU/UI time breakdown
- Classification: SMOOTH/JANK/BIG_JANK/HUGE_JANK
INTERPRETATION:
- Occasional jank (<1% frames): Normal
- Consistent jank (>5% frames): User-visible problem
- Jank clusters: Check for GC, I/O, or lock contention at those times
- SurfaceFlinger jank: System issue, not your app
FOLLOW-UP: Use frame timestamps to correlate with execute_sql_query for what was
happening during janky frames (GC events, binder calls, CPU frequency).