https://developer.android.com/agents/skills/profilers/perfetto-trace-analysis/skill

Diagnoses Android performance root causes in Perfetto traces using SQL evidence chains.

5|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/fornewid/android-developers-changelog --skill https-developer-android-com-agents-skills-profilers-perfetto-trace-analysis-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: https://developer.android.com/agents/skills/profilers/perfetto-trace-analysis/skill
Source: https://github.com/fornewid/android-developers-changelog/tree/main/docs/agents/skills/profilers/perfetto-trace-analysis
Command: npx skills add https://github.com/fornewid/android-developers-changelog --skill https-developer-android-com-agents-skills-profilers-perfetto-trace-analysis-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you identify the root cause of performance issues (CPU, graphics, I/O, IPC, memory, and power problems) inside an Android Perfetto trace by building a verified chain of evidence rather than relying on guesses.

Core Features & Use Cases

  • Evidence-based investigation workflow: Creates a per-trace scratchpad to record verified facts only, then iteratively forms hypotheses, collects data, and drills down with strict evidentiary rigor.
  • Domain-hints-driven profiling: Uses expert-vetted techniques across CPU scheduling, graphics rendering/memory, I/O stalls, binder/IPC patterns, memory pressure, and battery-related rails/wakelocks.
  • Perfetto SQL generation with guardrails: Follows the provided SQL execution protocol, including correct handling of incomplete slice durations (dur = -1), safe joins via UTID/UPID, and mandatory use of GLOB for matching.
  • Broad-to-narrow trace strategy: Starts with high-level metrics, then narrows with targeted queries; includes startup/package discovery when the request is broad.

Quick Start

Use the perfetto-trace-analysis skill to analyze the attached Perfetto trace and produce a verified root-cause report for the slow performance you observe.

Frequently Asked Questions about https://developer.android.com/agents/skills/profilers/perfetto-trace-analysis/skill

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

FAQPage Schema
How do I find the root cause of UI jank in a Perfetto trace?

Perfetto trace analysis diagnoses UI jank by building a verified chain of evidence across CPU scheduling, graphics rendering, and memory pressure, using targeted SQL queries to isolate the definitive root cause instead of relying on guesses.

What is the best way to analyze Android startup slowness using Perfetto SQL?

Analyzing Android startup slowness with Perfetto SQL uses a broad-to-narrow trace strategy, starting with high-level metrics and package discovery, then drilling down with targeted queries to expose scheduler contention or I/O stalls.

How does Perfetto trace analysis handle incomplete slice durations during profiling?

Perfetto trace analysis handles incomplete slice durations by enforcing a strict SQL execution protocol that correctly processes negative duration values and applies safe joins via UTID and UPID for accurate profiling results.

Can I diagnose device wake or suspend failures when the root cause is unclear?

Yes, you can diagnose unclear device wake or suspend failures by applying domain-hint-driven profiling to investigate battery-related rails and wakelocks, iteratively forming and verifying hypotheses within an evidence scratchpad.

Does Perfetto trace analysis work for diagnosing blocked threads and IPC binder dependencies?

Yes, Perfetto trace analysis diagnoses blocked threads and IPC binder dependencies by exhaustively investigating binder patterns and CPU scheduling stalls to verify the exact cause of long-running or blocked threads.