Profiling

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

Package format

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.