perfetto-trace-analysis

Analyzes Perfetto traces to diagnose latency, memory, and jank issues in Android apps.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/kariemSeiam/android-claw --skill perfetto-trace-analysis-kariemseiam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: perfetto-trace-analysis
Source: https://github.com/kariemSeiam/android-claw/tree/main/skills/installed/profilers-perfetto-trace-analysis
Command: npx skills add https://github.com/kariemSeiam/android-claw --skill perfetto-trace-analysis-kariemseiam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Android performance issues like jank, slow startup, and memory pressure are hard to root-cause from raw Perfetto traces. This Skill guides a structured, evidence-based investigation that turns a trace file into a verified chain of evidence identifying the definitive bottleneck. ## Core Features & Use Cases - Guided Investigation Protocol: Follows a hypothesis-driven loop (formulate, query, drill down, verify) with a mandatory scratchpad that logs only verified facts as a chain of evidence. - Domain-Specific Hints: Ships reference playbooks for CPU, graphics, I/O, IPC, memory, and power analysis, so investigations start from proven diagnostic patterns. - Perfetto SQL Execution Protocol: Enforces schema research against the Perfetto standard library, GLOB-based matching, utid/upid joins, and a validated draft-and-check loop before running queries via the trace_processor wrapper. - Use Case: Given a trace of a slow app launch, the Skill identifies the active package, queries startup slices, checks thread states for blocked time, follows binder or I/O dependencies across processes, and reports the root cause with supporting evidence. ## Quick Start Analyze the attached Perfetto trace file and find the root cause of the jank during scrolling.

Frequently Asked Questions about perfetto-trace-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze a Perfetto trace to find why my Android app is slow?▼

Provide the trace file and describe the symptom. The Skill identifies the target package, runs high-level trace metrics, then drills into slices and thread states with validated Perfetto SQL queries until it isolates the root cause.

How do I run Perfetto SQL queries on a trace file?▼

Queries are executed with the official trace_processor wrapper downloaded from get.perfetto.dev, using the --query-string flag. The Skill validates each query against the Perfetto standard library schemas before execution.

Can Perfetto trace analysis find the cause of UI jank?▼

Yes. It compares actual_frame_timeline against expected_frame_timeline, inspects long main-thread slices like measure and layout passes, and checks thread states to distinguish CPU contention from blocking on I/O or binder calls.

Why does my Perfetto SQL query fail or return wrong results?▼

Common causes include using LIKE instead of GLOB, joining on tid/pid instead of utid/upid, ignoring slices with dur = -1, or missing INCLUDE PERFETTO MODULE statements. The Skill's validation checklist catches these before execution.

What types of performance issues can Perfetto trace analysis detect?▼

It covers CPU scheduling latency, graphics memory pressure, I/O stalls such as page cache misses, binder transaction bottlenecks, memory thrashing and LMK kills, and power issues like kernel wakelocks preventing device suspend.