android-trace-sections

Instrument Android apps with Perfetto trace sections for timing and thread analysis.

7|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/himattm/skills --skill android-trace-sections
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-trace-sections
Source: https://github.com/himattm/skills/tree/main/plugins/android/skills/android-trace-sections
Command: npx skills add https://github.com/himattm/skills --skill android-trace-sections

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android performance analysis requires precise timing and thread context beyond logs; this skill provides trace sections to answer "what happened when" with per-thread visibility and frame-boundary correlation.

Core Features & Use Cases

  • AGENT_TRACE labeling for code sections to mark start/finish
  • Capture Perfetto traces on-device or host
  • Analyze traces with trace_processor queries to identify main-thread usage and frame correlation
  • Use in hot paths to diagnose jank, slow startup, and thread contention

Quick Start

Wrap suspect blocks with AGENT_TRACE_<id> labels or Trace.beginSection, capture a trace, and inspect the results to verify timing on each thread.

Frequently Asked Questions about android-trace-sections

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

FAQPage Schema
How do I instrument Android app code to capture per-thread timing for jank analysis?

Use Perfetto-based trace sections to instrument Android apps by wrapping suspect code blocks with Trace.beginSection or AGENT_TRACE labels. This provides per-thread visibility and frame-boundary correlation to quantify timing during jank analysis and cold-start optimization.

What is the best way to map code execution timing to frame budgets during an Android performance investigation?

Mapping execution timing to frame budgets requires applying Perfetto trace sections in hot paths to diagnose slow startup and thread contention. Capturing traces on-device or host provides the precise timing and thread context needed for the performance investigation.

Do I need androidx.tracing to use Perfetto trace sections for Android profiling?

Using Perfetto trace sections for Android profiling requires androidx.tracing or android.os.Trace with appropriate minSdk support. You must also integrate with trace-capture and analysis tools to complete the end-to-end performance workflow.

How do I analyze Perfetto traces to identify main-thread usage and frame correlation?

Analyze Perfetto traces by running trace_processor queries to identify main-thread usage and frame correlation. This provides per-thread visibility and precise timing to answer what happened when during performance investigations.

When should I use trace sections instead of standard logging for Android performance analysis?

Use trace sections instead of logging when Android performance analysis requires precise timing and thread context beyond logs. Trace sections provide per-thread visibility and frame-boundary correlation necessary for jank analysis and cold-start optimization.