Skip to content

Binder Transactions

Binder IPC transaction performance profiling.

Overview

Binder is Android's inter-process communication mechanism. Slow binder transactions can block the calling thread, causing ANRs and jank. perfetto-cli profiles binder calls to identify latency issues.

Commands

binder profile

Analyze binder transaction performance.

perfetto-cli -t trace.perfetto-trace -p com.example.app binder profile

Options:

Option Description Default
--min-latency <ms> Minimum transaction latency to report 10
--group-by <field> Group results by: aidl, server, none none

Examples:

# Show only slow transactions (>20ms)
perfetto-cli -t trace.perfetto-trace -p com.example.app binder profile --min-latency 20

# Group by AIDL interface
perfetto-cli -t trace.perfetto-trace -p com.example.app binder profile --group-by aidl

# Group by server process
perfetto-cli -t trace.perfetto-trace -p com.example.app binder profile --group-by server

Workflow

  1. Run binder profile to see all slow transactions
  2. Use --group-by aidl to identify which interfaces are slowest
  3. Cross-reference with cpu utilization on the server process to understand why

Tips

  • Binder calls on the main thread with >16ms latency will cause frame drops
  • Use --group-by server to identify slow system services
  • Combine with ANR analysis — binder timeouts are a common ANR cause