Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Simpleperf is a command-line native CPU profiling tool that helps you analyze your app’s performance on Vega devices. Use Simpleperf to identify CPU bottlenecks, excessive context switches, inefficient thread scheduling, and other performance issues that might not be visible through code review alone. It provides insights into CPU usage patterns across cores, function call frequencies and execution times, hardware performance counters, process scheduling behavior, and context switching patterns. Simpleperf works in two modes:
  • On-device — Collects real-time performance data by monitoring running apps and system activities.
  • On-host — Processes and displays data previously collected on the device.
Use Simpleperf when your app experiences unexpected frame drops, battery depletion, slow responsiveness, or when you suspect CPU usage is higher than expected.

When to use Simpleperf

Prerequisites

Before you begin, make sure you have:
  • Vega SDK installed
  • A Fire TV Stick device connected through VDA
  • Your app built and running on the device

Set up Simpleperf

Simpleperf isn’t included in the device image by default. You need to sideload the binary from the Vega SDK onto your device.

Step 1: Verify your build variant

Confirm that your device uses a user-external or user build variant. Either build works with Simpleperf, though user-external is more common:
Expected output:
or:

Step 2: Enable developer mode

Enable developer mode on the device:
For more details on developer mode, see Enable Developer Mode.

Step 3: Connect to your device and start your app

Open a shell connection to your device:
Start your app using vmsgr. For example:

Step 4: Push the Simpleperf binary to the device

The Simpleperf binary is located in the SDK at:
Push it to your app’s scratch folder:
Example output:
The binary is now available in the component shell’s tmp/scratch folder.

Step 5: Access the component shell

Open a new terminal on your host machine. You need a separate terminal because your first terminal is running the vda shell session from Step 3. Connect to the component shell:
Navigate to the scratch directory where you pushed the binary:
You can now run Simpleperf commands from this directory.

Find your app’s process ID

Before profiling, find your app’s process ID (PID):
Example output:
You can reference your app by PID, app ID, or pidof:

List available events

Use simpleperf list to see which events your device supports:
Additional filtering options include:
  • cache — Hardware cache events
  • raw — Raw CPU PMU events
  • tracepoint — Tracepoint events
  • cs-etm — CoreSight ETM instruction tracing events
  • pmu — System-specific PMU events
To display supported features on your device:
Example output for hardware events:
Example output for software events:
All listed events can be used with the -e option when running simpleperf stat and simpleperf record commands.

Collect performance statistics with stat

Use simpleperf stat to collect aggregate performance statistics for CPU events. This mode provides a concise summary of hardware and software events without the overhead of detailed sampling data. It’s useful for quick performance assessment and A/B testing of optimizations.
Example output:

Interpret stat results

Use these guidelines to interpret the output: For all available options, run simpleperf help stat.

Record detailed performance data

Use simpleperf record to collect in-depth CPU performance metrics by sampling CPU events at predefined intervals. All recorded data is stored in a perf.data file for subsequent analysis. Events can be scoped to monitor user space only (:u) or kernel space only (:k). For most Vega app profiling, use user space monitoring.
For all available options, run simpleperf help record.

Transfer performance data to your host machine

Performance data files are stored in the /scratch directory of the component shell. To retrieve them, open a terminal on your host machine (outside the component shell) and run:

Analyze performance data with report

Use simpleperf report on your host machine to analyze the collected perf.data file. Use the host version of Simpleperf provided with the SDK at:
Replace with your installed SDK version (for example, 0.23.6323).
Example output:
For all available options, run simpleperf help report.

Other commands

Simpleperf includes additional commands for specialized profiling needs: To see all sub-commands and their options:

Known limitations

Simpleperf relies on the perf_event_paranoid kernel parameter to determine its operational permissions. By default, this value is set to 2 on Vega OS, which restricts certain profiling capabilities for security reasons. For devices with user-external build variants and developer mode enabled, the value is automatically adjusted to 1, which allows more comprehensive profiling. However, unprivileged users are still restricted from:
  • Profiling kernel space events
  • Accessing hardware PMU events
  • Profiling other users’ processes
  • Collecting raw tracepoint events
  • Accessing kernel call graphs
  • Collecting kernel-mode stack traces

Best practices

Data collection

  • Always specify a duration or use controlled termination.
  • Use an appropriate sampling frequency.
  • Monitor system load during profiling.

Event selection

  • Start with basic events (cpu-cycles, instructions).
  • Avoid too many simultaneous hardware events.
  • Consider hardware limitations of your target device.

Report analysis

  • Compare multiple runs for consistent results.
  • Use appropriate filters to narrow down results.
  • Always check for lost samples.

Resource management

  • Clean up old perf.data files to free device storage.
  • Control CPU overhead by limiting sampling frequency.

Example: Diagnose frame drops during scrolling

This walkthrough shows how to use Simpleperf to investigate an app that drops frames when scrolling through a content list. 1. Confirm the problem with stat:
If you see high context-switches (>500/sec) or high cache-misses relative to cpu-cycles, there’s likely a performance issue worth investigating. 2. Record a call graph during the problematic interaction:
Scroll through your content list during the 10-second recording window. 3. Pull and analyze the data on your host machine:
4. Identify the bottleneck: Look for functions with high Overhead percentages. For example:
This tells you that 35% of CPU time is spent in Hermes JavaScript execution and 22% in React’s shadow tree commits — suggesting your scroll handler is doing too much JS work per frame. 5. Fix and verify: After optimizing (for example, memoizing expensive computations in your scroll handler), re-run the same stat command and confirm the metrics improve.
Last modified on June 18, 2026