Skip to content

CLI Commands

Complete reference for all perfetto-cli commands and options.

Global Options

These options apply to all analysis commands:

Option Description Default
-t, --trace <path> Trace file path Required
-p, --process <name> Process name filter None
-f, --format <type> Output format: text / table / json text
-v, --verbose Verbose output Off
--tp-path <path> Custom trace_processor binary path Auto
--version Show version and exit
--help Show help and exit

anr

anr detect

Detect ANR events with severity classification.

perfetto-cli -t <trace> -p <process> anr detect [OPTIONS]
Option Description Default
--min-duration <ms> Minimum ANR duration to report None

anr root-cause

Multi-signal ANR root cause analysis.

perfetto-cli -t <trace> -p <process> anr root-cause [OPTIONS]
Option Description Default
--anr-timestamp <ms> Timestamp of the ANR event Required

frame

frame jank

Detect janky frames with severity classification.

perfetto-cli -t <trace> -p <process> frame jank [OPTIONS]
Option Description Default
--threshold <ms> Jank threshold in milliseconds 16

frame summary

Frame performance summary with rating.

perfetto-cli -t <trace> -p <process> frame summary

cpu

cpu utilization

Per-thread CPU utilization breakdown.

perfetto-cli -t <trace> -p <process> cpu utilization [OPTIONS]
Option Description Default
--include-frequency Include CPU DVFS frequency info Off

cpu hotspots

Main thread hotspot slices (top-N by duration).

perfetto-cli -t <trace> -p <process> cpu hotspots [OPTIONS]
Option Description Default
--limit <n> Maximum hotspot slices to show 20

cpu contention

Thread contention analysis.

perfetto-cli -t <trace> -p <process> cpu contention

memory

memory leak

RSS-based memory leak detection.

perfetto-cli -t <trace> -p <process> memory leak [OPTIONS]
Option Description Default
--growth-threshold <MB/min> Minimum growth rate to flag 5

memory heap

Heap dominator tree analysis.

perfetto-cli -t <trace> -p <process> memory heap

binder

binder profile

Binder transaction profiling.

perfetto-cli -t <trace> -p <process> binder profile [OPTIONS]
Option Description Default
--min-latency <ms> Minimum latency to report 10
--group-by <field> Group by: aidl / server / none none

query

query sql

Execute raw PerfettoSQL query.

perfetto-cli -t <trace> query sql [OPTIONS]
Option Description
--query <sql> SQL query string
--file <path> Path to SQL file

query find-slices

Search slices by name pattern.

perfetto-cli -t <trace> query find-slices [OPTIONS]
Option Description Default
--pattern <text> Search pattern Required
--match-type <type> contains / exact / glob contains

query slice-info

Get slice details by ID.

perfetto-cli -t <trace> query slice-info --slice-id <id>

trace

trace start

Start device trace capture.

perfetto-cli trace start [OPTIONS]
Option Description Default
--duration <time> Capture duration 10s
--buffer-size <size> Ring buffer size 32mb

trace stop

Stop capture and pull trace file.

perfetto-cli trace stop

trace run

One-shot capture (start → wait → stop → pull).

perfetto-cli trace run [OPTIONS]
Option Description Default
--duration <time> Capture duration 10s
-o, --output <dir> Output directory Current dir

skills

skills install

Install a skill from source.

perfetto-cli skills install <source>

skills list

List installed skills.

perfetto-cli skills list

skills uninstall

Remove an installed skill.

perfetto-cli skills uninstall <name>