$npx -y skills add Gracker/Perfetto-Skills --skill perfetto-performance-analysisAnalyze Android, Linux, and Chromium Perfetto traces with local trace_processor_shell evidence. Use for startup, scrolling or jank, input latency, ANR, CPU scheduling, memory or GC, Binder or IO, GPU or SurfaceFlinger, power or thermal, rendering-pipeline identification, trace ca
| 1 | # Perfetto Performance Analysis |
| 2 | |
| 3 | Analyze traces from evidence instead of guessing from symptom names. Use the |
| 4 | bundled scripts for deterministic queries and load only the references needed |
| 5 | for the selected workflow. |
| 6 | |
| 7 | ## Operating contract |
| 8 | |
| 9 | 1. Resolve the Skill root as the directory containing this `SKILL.md`. Convert |
| 10 | script and reference paths to absolute paths before executing them; do not |
| 11 | assume a client-specific environment variable exists. |
| 12 | 2. Record every input trace path, SHA-256, requested process/thread, time range, |
| 13 | and trace side before analysis. |
| 14 | 3. Run `scripts/perfetto_probe.py` before domain queries. Treat unavailable |
| 15 | tables, modules, tracks, or trace signals as limitations, not negative |
| 16 | evidence. |
| 17 | 4. Select one primary workflow below. Load its Markdown file directly, then |
| 18 | follow its availability gate and evidence sequence. |
| 19 | 5. Execute a complete exported Skill through `scripts/perfetto_skill.py run`, |
| 20 | or one manifest query through `scripts/perfetto_query.py --query-id`. Keep query source, |
| 21 | parameters, trace identity, timestamps, durations, units, and returned row |
| 22 | bounds with every saved result. |
| 23 | 6. Before executing authored or modified SQL, run |
| 24 | [the SQL guardrail script](scripts/perfetto_sql_guardrails.py). Resolve blocking findings and review |
| 25 | advisories using [the SQL guardrail contract](references/evidence/sql-guardrails.md). |
| 26 | 7. Separate observations, correlations, mechanisms, and verified root causes. |
| 27 | Do not promote a hypothesis without evidence that supports the claimed |
| 28 | process, thread, time window, and trace. |
| 29 | 8. For comparisons, analyze each trace independently before computing deltas. |
| 30 | Never use a missing metric on one side as proof that the other side regressed. |
| 31 | 9. Emit the structure in `assets/report-schema.json`. List missing evidence and |
| 32 | unresolved alternatives under `limitations`. |
| 33 | |
| 34 | Read [the evidence contract](references/evidence/evidence-contract.md), then use |
| 35 | [identity rules](references/evidence/identity.md), |
| 36 | [missing-data rules](references/evidence/missing-data.md), and |
| 37 | [claim verification](references/evidence/claim-verification.md) before writing |
| 38 | conclusions. |
| 39 | |
| 40 | ## Workflow routing |
| 41 | |
| 42 | - Trace health, bounds, identity, and broad triage: [trace overview](references/workflows/trace-overview.md) |
| 43 | - Cold, warm, hot, and first-frame startup: [startup](references/workflows/startup.md) |
| 44 | - Frame production, presentation, scrolling, and jank: [scrolling](references/workflows/scrolling.md) |
| 45 | - Touch, click, input dispatch, response, and navigation: [interaction](references/workflows/interaction.md) |
| 46 | - ANR, Binder, locks, futex, and blocking chains: [ANR and blocking](references/workflows/anr-blocking.md) |
| 47 | - CPU load, topology, frequency, idle, IRQ, and scheduler latency: [CPU scheduling](references/workflows/cpu-scheduling.md) |
| 48 | - RSS, heap, GC, LMK, DMA-BUF, and allocation: [memory](references/workflows/memory.md) |
| 49 | - GPU, SurfaceFlinger, fences, VRR, and frame composition: [GPU rendering](references/workflows/gpu-rendering.md) |
| 50 | - Rails, wakelocks, battery, thermal, and throttling: [power and thermal](references/workflows/power-thermal.md) |
| 51 | - Filesystem, block IO, network, modem, media, and WebView: [IO, network, and media](references/workflows/io-network-media.md) |
| 52 | - Compose, Flutter, React Native, games, and vendor signals: [frameworks and games](references/workflows/frameworks-games.md) |
| 53 | - Rendering architecture detection and teaching: [rendering pipeline](references/workflows/rendering-pipeline.md) |
| 54 | - Cross-domain event sequence reconstruction: [scene reconstruction](references/workflows/scene-reconstruction.md) |
| 55 | - Two or more traces or saved result sets: [trace comparison](references/workflows/trace-comparison.md) |
| 56 | |
| 57 | Use [the machine-readable workflow index](references/workflow-index.json) when |
| 58 | selecting or validating workflow IDs. |
| 59 | |
| 60 | ## Runtime commands |
| 61 | |
| 62 | List or run a deterministic portable Skill graph: |
| 63 | |
| 64 | ```bash |
| 65 | python3 <skill-root>/scripts/perfetto_skill.py list |
| 66 | python3 <skill-root>/scripts/perfetto_skill.py run /absolute/trace.pftrace \ |
| 67 | --skill startup_analysis --param 'package="com.example"' \ |
| 68 | --output-dir /absolute/output/run |
| 69 | ``` |
| 70 | |
| 71 | Complete Skill runs and `--query-id` runs verify the selected processor's |
| 72 | v57.2 commit, RPC API, |