perfetto-trace-analysis

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

1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill perfetto-trace-analysis-citytexi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: perfetto-trace-analysis
Source: https://github.com/citytexi/team-yg-pesonal-agent/tree/main/.claude/skills/perfetto-trace-analysis
Command: npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill perfetto-trace-analysis-citytexi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Android performance problems like jank, slow startup, memory pressure, and battery drain are hard to root-cause from raw Perfetto traces. This Skill guides an AI through a rigorous, evidence-based investigation of a trace file so you get a verified root cause instead of guesswork. ## Core Features & Use Cases - Structured Investigation Protocol: Follows a hypothesis-driven loop (formulate, query, drill down, verify) with a mandatory scratchpad that logs a strict chain of evidence (timestamps, slice names, thread states). - Expert Domain Hints: Ships reference files for CPU, Graphics, I/O, IPC, Memory, and Power, each containing expert-vetted trace analysis techniques to steer the investigation. - Perfetto SQL Execution Protocol: Enforces schema research against the Perfetto standard library documentation, GLOB-based matching, utid/upid joins, and validated query drafting before execution via the trace_processor wrapper. - Use Case: You capture a Perfetto trace of your app's cold start being slow. Hand the trace to the Skill, which identifies the package, queries startup metrics, discovers the main thread blocked in uninterruptible sleep on dm-verity I/O, and reports the full dependency chain to the root cause. ## Quick Start Analyze the attached Perfetto trace file and find the root cause of the jank during scrolling in my Android app.

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 iteratively queries slices, thread states, and scheduling data to follow the dependency chain to the verified root cause.

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

Queries are executed with the official trace_processor wrapper using the --query-string flag, e.g. ./trace_processor --query-string "QUERY" trace_file. The wrapper is downloaded from get.perfetto.dev and lazy-loads the precompiled binary on first run.

What performance problems can Perfetto trace analysis diagnose?▼

It covers CPU contention and scheduling latency, UI jank and graphics memory, I/O stalls like dm-verity and page faults, binder IPC bottlenecks, memory pressure and LMK kills, and power issues like wake locks and battery drain.

Why should I use utid instead of tid in Perfetto SQL queries?▼

The operating system recycles tids and pids, so joins on them can produce incorrect results. utid and upid remain unique for the lifetime of the trace, making them safe join keys between thread, process, slice, and scheduling tables.

Does the analysis work if my performance issue has multiple causes?▼

Yes. The protocol explicitly requires exhaustive investigation: after finding one bottleneck it continues searching domain hints and runs system-wide queries for the longest slices and most frequent D-states to catch independent issues.