Output Formats¶
perfetto-cli supports three output formats, controlled by the -f, --format option.
text (default)¶
Human-friendly colorized output using Rich. Best for interactive terminal use.
Features:
- Color-coded severity levels
- Aligned columns
- Summary statistics
- Progress indicators for long operations
table¶
ASCII table format. Suitable for aligned data viewing without color dependencies.
Features:
- Clean ASCII borders
- Works in any terminal
- Good for copy-paste into documents
json¶
Machine-readable JSON output. Best for scripting, piping, and CI integration.
Features:
- Structured data for programmatic access
- Pipe to
jqfor filtering and transformation - Suitable for CI/CD pipelines
Examples with jq¶
# Count janky frames by severity
perfetto-cli -t trace.perfetto-trace -p com.app frame jank -f json | jq 'group_by(.severity) | map({severity: .[0].severity, count: length})'
# Get only HUGE_JANK frames
perfetto-cli -t trace.perfetto-trace -p com.app frame jank -f json | jq '.[] | select(.severity == "HUGE_JANK")'
# Extract ANR timestamps
perfetto-cli -t trace.perfetto-trace -p com.app anr detect -f json | jq '.[].timestamp'