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://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

analysis/workflows/perfetto-trace-analysis/references/per_candidate_analysis.md

Execute the protocol below using the candidate details (Trace Paths, Symptom Window, UTID, System Vitals) provided in your initial prompt.

Guiding Principles for Trace Analysis

Follow these principles to identify root causes, ensure data-driven analysis, and avoid pitfalls while discovering the real bottleneck.

  1. Schema Validation via Intrinsic Discovery: Read $SKILL_ROOT/references/perfetto/sql.md and query table schemas using LIMIT 0 before drafting queries.

    • Why: Trace processor schemas evolve across versions; discovering schema directly prevents invalid assumptions and syntax failures.

  2. Empirical Data Grounding: Support every claim with queried timestamps, slice durations or counter values ([SQL]).

    • Why: General Android heuristics cannot substitute for ground-truth trace metrics. When queries return empty results, broaden search constraints using fuzzy matching or wider time windows.

  3. Causation vs. Correlation: Verify that the blocker's active execution overlaps with the victim's wait interval.

    • Why: Concurrent anomalies are only causally linked if their execution lifetimes intersect. For example, just because thread A was busy while thread B was waiting does not necessarily mean thread A caused the wait.

  4. Follow Evidence: Follow dependency chains across thread, process and kernel boundaries as long as each hop meaningfully explains the symptom.

    • Why: Halting blocker traversal prematurely reports intermediate symptoms rather than the true origin.

  5. Explicit Uncertainty Reporting: Categorize unverified execution paths as [GAP] or partial suspects.

    • Why: Transparent reporting of missing data enables engineers to evaluate probabilities without false certainty.

  6. Evidence-First Explanation: Cite concrete retrieved metrics and slice timestamps before asserting platform behavioral context.

    • Why: Contextual explanations are only reliable when anchored in empirical trace observations.

  7. Systemic Confound Sweeps: Before attributing a bottleneck to application software, verify that thermal throttling, CPU capping (cpufreq), scheduling (sched_slice), or LMKD pressure isn't uniformly degrading the system. Report such confounds as root cause modifiers.

    • Why: Software execution duration is not an absolute constant; it is modulated by the platform and hardware state. Hardware throttling can artificially inflate wall-clock time without increasing the instruction overhead, which can make healthy code look like an inefficient bottleneck.

    To uncover short-lived anomalies that get mathematically missed by simple averages or aggregate queries, isolate and look around the symptom window and query for individual event spikes or percentiles.

Investigation Steps

Step 1: Setup and Baseline Verification
  1. Follow $SKILL_ROOT/references/perfetto/sql.md for session-based query execution.

  2. Establish a Baseline:

    • A/B Baseline: If a Baseline Trace Path was provided, query that trace first to establish expected slicing patterns, thread states, and execution budgets.

    • In-Trace Baseline: If no separate baseline was provided, locate a healthy, non-janky instance of the same operation earlier in the current trace.

    • If no baseline is available anywhere, tag as [GAP] and proceed.

Step 2: Calculate Time Distribution and State Buckets
  1. Sum time spent across thread states: Calculate the exact duration spent in Running, R, S and D states within the symptom window.

  2. Investigate significant buckets: Target all significant state buckets (for example, accounting for >= 20% of the window duration). Investigate the largest bucket first.

  3. Look for composite bottlenecks: Identify if there are any composite bottlenecks (for example, "40% CPU-starved + 35% IO-blocked").

  4. Rule out false positives / red herrings:

    • Sleeping (S): Benign unless the sleep overlaps with an active pending obligation (for example, a pending binder reply).

    • Running/Runnable (R): Inspect cpu_frequency, throttling counters, scheduling latency, and core migrations before attributing latency solely to code inefficiency (see Guiding Principle 7).

      • Query the trace and slice table for both the longest duration slices and repetitive micro-operations or gaps to prevent tunnel vision.

  5. Drill-down at transitions: For each significant bucket, query what the thread was executing at state entry and exit points. Tag untraced or ambiguous segments as [GAP]. Do not guess.

Step 3: Domain and Hints Discovery
  1. Perform a recursive search on the frontmatter (category:, description:, keywords:) of files in $SKILL_ROOT/analysis/workflows/perfetto-trace-analysis/references/hints/ to identify hint files matching the collective investigation state (for example, observed victim, affected subsystems, and intermediate processes).

  2. Read and apply all matched hint files during the Step 4 investigation - these contain expert-vetted diagnostics and guidelines essential for uncovering non-obvious bottlenecks. List every applied hint file under Applied Hints in your Step 6 output.

Step 4: Exhaustive Root Cause Traversal
  1. Follow the dependency chain to the leaf: If the victim thread was blocked or waiting on another thread or process, follow the waker and server chain across process boundaries until reaching a leaf. Do not stop at intermediate wakers (see Guiding Principle 4).

    • Dynamic hint injection: If traversal leads to a new subsystem or process, perform a targeted frontmatter search in $SKILL_ROOT/analysis/workflows/perfetto-trace-analysis/references/hints/ for any new hints that may apply.

    • State bucket exit states: Every state bucket investigation should conclude in one of three states: Terminal Root Cause , Blocked by Another Thread or Partial Suspect.

      Decision Matrix per State Bucket:

      Outcome / FindingActionCriteria & Examples
      Blocked by Another ThreadContinue TraversalFollow waker/dependency chain across thread and process boundaries to find what the blocker was waiting for.
      Terminal: Physical BottleneckStop and ClassifyThermal throttle, GPU saturation, storage or I/O bottleneck.
      Terminal: Software InefficiencyStop and ClassifyCode doing disproportionate work (for example, synchronous disk I/O on main thread, allocation churn).
      Terminal: Scheduling / PlatformStop and ClassifyBackground CPU quota, cgroup caps, foreground service restriction.
      Terminal: External Service StallStop and ClassifyPlatform contention with no further hops (for example, system_server lock, SurfaceFlinger throttling).
      Partial SuspectStop and Tag [GAP]Path unverified due to data gaps.
  2. Perform a systemic sweep before concluding: Discovering an application- layer code inefficiency does not terminate the investigation. Apply Guiding Principle 7 to verify whether platform-level confounds simultaneously degraded performance around the expanded symptom window. Report discovered confounds as co-root causes or duration modifiers.

Step 5: Contextualize the Workload

Once the mechanical bottleneck is identified, query the trace to identify the high-level user feature, UI operation, or exact workload that triggered it. Explain the why , not just the what, to ensure recommendations are clear and actionable for engineers.

Step 6: Output Format

Output the investigation result adhering strictly to this schema:

# Investigation Result

- **Candidate:** [Package / Thread / Classification]
- **Symptom Window:** [Start TS] - [End TS] ([Duration ms])
- **Budget (Expected Duration):** [If known / applicable, else "N/A"]
- **Applied Hints:** [List of matched hint files used]

## Primary Finding

- **Classification:** [Hardware | Software/Code | System Exhaustion | Scheduling Policy | External Dependency]
- **Details and Reasoning:** `___`
- **Explained Duration:** `[X ms (Y% of window)]`
- **Evidence SQL or Backing Data:** `___`
- **Dependency Chain:** `[Root to Leaf Dependency Chain with UTIDs, UPIDs, and Timestamps]`
- **Root Cause Conclusion:** `___`

## Other Findings / Partial Suspects

- **Status:** [Partial Suspect | Low Confidence Suspicion | Terminal Root Cause]
- *(same fields as Primary Finding)*

## Verification Checklist

- [ ] All claims tagged (`[SQL]` / `[GAP]` / `[INFERRED]`)
- [ ] Total explained duration accounts for the majority of the symptom window
- [ ] Unexplored state buckets: [None / list with reasons]
- [ ] Workload contextualized (specific UI actions/slices identified)

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