perfetto-sql

Execute SQL queries on Android Perfetto trace files to extract performance data.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/Kaito-Dogi/smopin --skill perfetto-sql-kaito-dogi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perfetto-sql
Source: https://github.com/Kaito-Dogi/smopin/tree/main/.agents/skills/android-skills/profilers/perfetto-sql
Command: npx skills add https://github.com/Kaito-Dogi/smopin --skill perfetto-sql-kaito-dogi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires trace_processor, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables users to translate natural language data intents into syntactically valid Perfetto SQL queries, executing them against local trace files to extract slice, thread, or memory data from Android Perfetto traces.

Core Features & Use Cases

  • SQL Query Execution: Execute SQL queries on local trace files to analyze performance data.
  • Data Extraction: Extract specific data such as slices, threads, or memory information from Perfetto traces.
  • Use Case: For example, to find out the duration of all slices matching a specific name pattern, you can use this Skill to run a SQL query and get the required information.

Quick Start

Use the perfetto-sql skill to execute the following query on the trace file 'trace.bin': SELECT count(*) as total_count, sum(IIF(slice.dur = -1, trace_end() - slice.ts, slice.dur)) / 1000000.0 as total_dur_ms FROM slice WHERE slice.name GLOB '*RenderThread*'.

Frequently Asked Questions about perfetto-sql

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

FAQPage Schema
How do I query Android Perfetto trace files for slice duration data?

To query Android Perfetto trace files, execute SQL queries against local trace files using trace_processor to extract slice, thread, or memory performance data. You can calculate specific durations by filtering slice names with GLOB patterns.

Can I use SQL to extract thread and memory information from Perfetto traces?

Yes, you can use SQL to extract thread and memory information from Perfetto traces. The Skill translates data intents into syntactically valid Perfetto SQL queries, executing them locally to retrieve specific performance metrics.

What is the best way to analyze Android performance traces without manual SQL syntax knowledge?

Analyzing Android performance traces is done by translating natural language intents into syntactically valid Perfetto SQL queries. However, this process requires trace_processor and existing Perfetto SQL syntax knowledge to execute queries correctly.

Does Perfetto SQL execution require any specific dependencies or local setup?

Perfetto SQL execution requires the trace_processor dependency and local trace files. You need Perfetto SQL syntax knowledge to execute queries and successfully extract performance data from your Android trace files.

How do I calculate the total duration of specific slices in a Perfetto trace?

To calculate the total duration of specific slices in a Perfetto trace, execute a SQL query summing slice durations while filtering by name. Use trace_end() to handle slices with a duration of -1 for accurate total time calculation.

Why do I need Perfetto SQL syntax knowledge to analyze my local trace files?

You need Perfetto SQL syntax knowledge because the Skill translates natural language intents into syntactically valid Perfetto SQL queries. This ensures accurate execution against local trace files to extract the required slice, thread, or memory data.