Generated banner for Android Profiler
Generated logo for Android Profiler

Android Profiler

Android (Google)OfficialCreated by Google LLCDistributed by Android (Google)

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Records and analyzes Android performance data and diagnoses performance bottlenecks across user apps, system apps, and system services, even if the user does not explicitly mention profiling or traces. Use when: recording system traces, CPU call stacks, Vulkan GPU/DRM memory, or Java/native heap profiles; analyzing Perfetto traces for UI jank, frame drops, ANRs, or app startup latency issues; investigating CPU bottlenecks, IPC/Binder storms, or thread scheduling stalls; diagnosing battery drain, modem power rails, and kernel wake locks; debugging memory pressure, Low Memory Kills (LMK), OOMs, leaks, and allocation churn; performing A/B baseline trace comparisons to find regressions; executing ad hoc PerfettoSQL queries on Android traces.
— the description by Google LLC

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The android-profiler skill provides a structured approach to capturing and interpreting Android performance data. It acts as an orchestrator for recording system traces, heap dumps, and CPU profiles, and provides workflows for deep-dive analysis using Perfetto. The skill is designed to help developers identify the root causes of UI jank, memory leaks, battery drain, and system-level performance regressions by leveraging standardized trace analysis and SQL-based querying.

What it does

  • Records system traces, CPU call stacks, and memory heap profiles.
  • Analyzes Perfetto traces to identify UI jank, frame drops, and startup latency.
  • Investigates system-level issues like IPC Binder storms and thread scheduling stalls.
  • Diagnoses power-related issues including battery drain and kernel wake locks.
  • Debugs memory pressure, LMK events, and native or Java heap leaks.
  • Executes custom PerfettoSQL queries for advanced trace data exploration.

When to use it

  • When you need to investigate app startup latency or intermittent UI jank.
  • When diagnosing memory-related crashes like OOMs or excessive allocation churn.
  • When analyzing system-wide performance regressions using A/B trace comparisons.
  • When you need to profile power consumption or modem power rail activity.
  • When you need to perform ad hoc analysis on complex Android system traces.

Advantages

  • Provides a unified workflow for both recording and analyzing performance data.
  • Reduces ambiguity by enforcing clear intent disambiguation before execution.
  • Includes specialized reference hints for CPU, memory, graphics, and power analysis.
  • Supports advanced data exploration via PerfettoSQL integration.
  • Ensures consistent environment setup through standardized path management.

Usage examples

“My app is stuttering during scrolling. Can you help me find the cause?”
The agent will initiate a trace recording session focused on UI jank, then guide you through analyzing the resulting Perfetto trace for frame drops and thread stalls.
“I suspect a memory leak in my application. How can I investigate?”
The agent will help you capture a Java or native heap dump and provide steps to analyze the memory allocation patterns to identify potential leaks.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/android/android-profiler/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip android-profiler.zip -d .agents/skills

Documentation by Google LLC

Your primary role is to figure out what the user wants to do (disambiguation), find the right instructions for it (workflow discovery), and follow them step-by-step (following the execution plan). If the request is unclear, work with the user to finalize the execution plan before proceeding.

Prerequisites and Setup

Before executing any workflows, read references/env_setup.md. It defines what to set $SKILL_ROOT to - the anchor every other path in this skill is written against.

Intent Disambiguation

Do not guess the user's intent. If the user request is not clear, ask the user what they want to do before proceeding.

Recording

Route all recording requests through recording/recording_orchestrator. This defines guidelines and pre-flight checks or dependency checks that apply to all recording workflows, and ensures you have the necessary setup to proceed. Read the orchestrator and execute the plan it describes based on what the user wants to record (for example, a system trace or a heap dump).

Analysis

Route all analysis requests through analysis/analysis_orchestrator.

Files

recording/workflows/perfetto-trace-recording/references/trace_config_reference.md

Read this when you need a custom trace config - a mixture of data sources the specialized helper scripts do not cover. Start from the exemplar configs in $SKILL_ROOT/recording/workflows/perfetto-trace-recording/references/example-configs/, then add, remove, or merge the pieces described below.

Shape of a config

A config is a TraceConfig protobuf - authoritative schema: https://raw.githubusercontent.com/google/perfetto/main/protos/perfetto/config/trace_config.proto (per-source option messages live under protos/perfetto/config/ in the same repo, e.g. .../ftrace/ftrace_config.proto) - written in protobuf text format (conventionally saved as config.pftxt):

buffers {
  size_kb: 32768            # sizes are in KB, not bytes
  fill_policy: RING_BUFFER  # keep newest data; DISCARD keeps oldest
}
duration_ms: 10000          # omit to trace until stopped manually

data_sources {
  config {
    name: "linux.ftrace"    # which producer to enable
    ftrace_config { ... }   # that producer's own options
  }
}
# ...more data_sources blocks, one per source...

Merging two configs = keep one buffers section and concatenate their data_sources blocks. Each data source may appear at most once (the linux.ftrace config especially: merge all ftrace_events, atrace_categories, and atrace_apps entries into a single block).

Exemplar configs

Location: $SKILL_ROOT/recording/workflows/perfetto-trace-recording/references/example-configs/

FileUse case
sched_cpu.pftxtCPU scheduling + frequency/idle (base layer).
app_jank.pftxtSlow UI / dropped frames: atrace + frame timeline.
memory_counters.pftxtSystem + per-process memory, LMK activity.
java_heap_dump.pftxtJava heap retention graph for one app.
native_heap.pftxtSampled native malloc/free callstacks (heapprofd).
cpu_profile.pftxtPeriodic CPU callstack samples (traced_perf).
long_background.pftxtLong/field traces: ring buffer + periodic writes.

For a standalone heap dump, native heap profile, or CPU profile, prefer the dedicated helper scripts in: $SKILL_ROOT/recording/workflows/perfetto-trace-recording/perfetto_trace_recording.md. Use exemplars when one trace must combine several sources.

Data sources at a glance

nameWhat it recordsKey options
linux.ftraceKernel events and atraceftrace_events, atrace_categories, atrace_apps
linux.process_statsProcess/thread names & statsscan_all_processes_on_start, proc_stats_poll_ms
linux.sys_statsPeriodic /proc countersmeminfo_period_ms, vmstat_period_ms, stat_period_ms
android.logLogcatandroid_log_config { log_ids: ... }
android.surfaceflinger.frametimelineFrame timelines (jank)None needed
android.java_hprofJava heap dumpjava_hprof_config { process_cmdline: ... }
android.heapprofdNative heap profilingheapprofd_config { sampling_interval_bytes, ... }
linux.perfCPU callstack samplingperf_event_config { timebase, callstack_sampling }
android.packages_listPackage mappingNone needed
android.powerBattery countersandroid_power_config { battery_poll_ms, ... }
track_eventCustom app trace eventstrack_event_config { enabled_categories }

The full, authoritative field list for every data source is the generated TraceConfig reference; per-source guides live under perfetto.dev/docs/data-sources.

Top-level knobs

  • duration_ms - trace length. Omit it to trace until the recording command is stopped (Ctrl-C on record_android_trace).

  • buffers.fill_policy - RING_BUFFER keeps newest data (right choice when the interesting moment is at the end); DISCARD keeps the oldest.

  • Long traces: write_into_file: true + file_write_period_ms stream buffer to disk periodically so the trace can exceed RAM; flush_period_ms: 30000 keeps app-emitted events ordered; max_file_size_bytes bounds output.

  • Buffer sizing rule of thumb: 32--64 MB (size_kb: 32768--65536) is plenty for most 10--30s traces; heap dumps need ~100 MB or write_into_file.

Pitfalls

  • All buffer sizes are KB (size_kb: 32768 = 32 MB); durations are ms.

  • atrace data (categories and app events) only flows through the linux.ftrace data source - there is no separate "atrace" source, and an app's custom trace events appear only if its package is listed in atrace_apps (or atrace_apps: "*").

  • Field-name typos are only caught when the config is parsed at record time: record_android_trace -c config.pftxt fails fast with a parse error naming the bad field, so treat that as your validator, fix, and retry.

  • Text-format enum values are bare identifiers (fill_policy: RING_BUFFER), and strings are quoted.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Google LLC
Publisher
Android (Google) (Official)
Distributed by
Android (Google)
Source
android/skills · profilers/android-profiler · commit bf68e2d
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.txt)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google LLC or Android (Google).

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download android-profiler.zip