Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Profiling
Stay organized with collections
Save and categorize content based on your preferences.
The Profiling module was introduced in Android 16 and lets apps collect
profiling data using Perfetto on public devices in the field.
- Apps can request profiling using Java heap dump, heap profile, stack
sampling, or system trace, and set select configurations for each.
- Apps can register interest in receiving traces of certain events and the
system can start and stop the trace for the apps.
- Results are redacted to contain information relating to the requesting
process only and delivered to the app's storage directory for further
processing by the app.
- Requests are rate limited and not guaranteed to be filled.
Module boundary
- Profiling Mainline APEX -
com.google.android.profiling
:
- Profiling API surface (Java):
- Code location:
packages/modules/Profiling/framework
- Process:
boot_class_path
ProfilingService
(Java):
- Code location:
packages/modules/Profiling/service
- Process:
system_server
The Profiling module ships as an APEX package (com.google.android.profiling
).
The module contains two JAR files:
framework-profiling.jar
: Contains the API surface that a caller interacts
with. This is a part of the bootclasspath.
service-profiling.jar
: Contains a new system service, ProfilingService
.
Loaded by the system server process.
Dependencies
This module has no external dependencies.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-29 UTC.
[null,null,["Last updated 2025-08-29 UTC."],[],[],null,["# Profiling\n\nThe Profiling module was introduced in Android 16 and lets apps collect\nprofiling data using Perfetto on public devices in the field.\n\n- Apps can request profiling using Java heap dump, heap profile, stack sampling, or system trace, and set select configurations for each.\n- Apps can register interest in receiving traces of certain events and the system can start and stop the trace for the apps.\n- Results are redacted to contain information relating to the requesting process only and delivered to the app's storage directory for further processing by the app.\n- Requests are rate limited and not guaranteed to be filled.\n\nModule boundary\n---------------\n\n- Profiling Mainline APEX - `com.google.android.profiling`:\n - Profiling API surface (Java):\n - Code location: `packages/modules/Profiling/framework`\n - Process: `boot_class_path`\n - `ProfilingService` (Java):\n - Code location: `packages/modules/Profiling/service`\n - Process: `system_server`\n\nPackage format\n--------------\n\nThe Profiling module ships as an APEX package (`com.google.android.profiling`).\nThe module contains two JAR files:\n\n- `framework-profiling.jar`: Contains the API surface that a caller interacts with. This is a part of the bootclasspath.\n- `service-profiling.jar`: Contains a new system service, `ProfilingService`. Loaded by the system server process.\n\nDependencies\n------------\n\nThis module has no external dependencies."]]